Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 26f30f8

Browse files
committed
Return valid EmptyTask for SL5
1 parent 7ef20be commit 26f30f8

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/ServiceStack.Text/PclExport.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,17 @@ public static bool ConfigureProvider(string typeName)
9090
public static void Configure(PclExport instance)
9191
{
9292
Instance = instance ?? Instance;
93+
94+
if (Instance != null && Instance.EmptyTask == null)
95+
{
96+
var tcs = new TaskCompletionSource<object>();
97+
tcs.SetResult(null);
98+
Instance.EmptyTask = tcs.Task;
99+
}
93100
}
94101

102+
public Task EmptyTask;
103+
95104
public bool SupportsExpression;
96105

97106
public bool SupportsEmit;
@@ -482,7 +491,7 @@ public virtual Task WriteAndFlushAsync(Stream stream, byte[] bytes)
482491
#else
483492
stream.Write(bytes, 0, bytes.Length);
484493
stream.Flush();
485-
return Task.FromResult(0);
494+
return EmptyTask;
486495
#endif
487496
}
488497
}

0 commit comments

Comments
 (0)