mirror of
https://github.com/FabInfra/capnproto-dotnetcore_Runtime.git
synced 2025-04-21 02:26:31 +02:00
More troubleshooting
This commit is contained in:
parent
198f778d65
commit
8b2be28eb0
@ -31,22 +31,24 @@ namespace Capnp.Rpc
|
|||||||
|
|
||||||
var rtask = AwaitAnswer();
|
var rtask = AwaitAnswer();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
// Really weird: We'd expect AwaitAnswer() to initialize a new Task instance upon each invocation.
|
// Really weird: We'd expect AwaitAnswer() to initialize a new Task instance upon each invocation.
|
||||||
// However, this does not seem to be always true (as indicated by CI test suite). An explanation might be
|
// However, this does not seem to be always true (as indicated by CI test suite). An explanation might be
|
||||||
// that the underlying implementation recycles Task instances (um, really? doesn't make sense. But the
|
// that the underlying implementation recycles Task instances (um, really? doesn't make sense. But the
|
||||||
// obsevation doesn't make sense, either).
|
// observation doesn't make sense, either).
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
_taskTable.Add(rtask, promise);
|
_taskTable.Add(rtask, promise);
|
||||||
}
|
}
|
||||||
catch (ArgumentException)
|
catch (ArgumentException)
|
||||||
{
|
{
|
||||||
// Force .NET to create a new Task instance
|
// Force .NET to create a new Task instance
|
||||||
|
|
||||||
|
var stask = rtask;
|
||||||
|
|
||||||
async Task<T> AwaitAgain()
|
async Task<T> AwaitAgain()
|
||||||
{
|
{
|
||||||
return await rtask;
|
return await stask;
|
||||||
}
|
}
|
||||||
|
|
||||||
rtask = AwaitAgain();
|
rtask = AwaitAgain();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user