We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c49678 commit f8e5978Copy full SHA for f8e5978
src/protobuf-net.Grpc/Internal/MetadataContext.cs
@@ -27,7 +27,7 @@ internal Metadata Headers
27
28
internal Task<Metadata>? GetHeadersTask(bool createIfMissing)
29
{
30
- return _headersTaskOrSource switch
+ return Volatile.Read(ref _headersTaskOrSource) switch
31
32
Task<Metadata> task => task,
33
TaskCompletionSource<Metadata> tcs => tcs.Task,
@@ -60,7 +60,7 @@ internal MetadataContext Reset()
60
61
Status = Status.DefaultSuccess;
62
_trailers = null;
63
- _headersTaskOrSource = null;
+ Volatile.Write(ref _headersTaskOrSource, null);
64
return this;
65
}
66
0 commit comments