Skip to content

Commit

Permalink
improve race condition comment
Browse files Browse the repository at this point in the history
  • Loading branch information
maririos committed Jun 5, 2020
1 parent 8e80b6e commit fc1806f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ private async ValueTask<Response> UpdateStatusAsync(bool async, CancellationToke

if (update.Value.Status == OperationStatus.Succeeded)
{
// we need to first assign a vaue and then mark the operation as completed to avoid race conditions
// We need to first assign a value and then mark the operation as completed to avoid a race condition with the getter in Value
_value = ConvertValue(update.Value, _targetModelId, CustomFormModelStatus.Ready);
_hasCompleted = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public virtual RecognizeContentOperation StartRecognizeContent(Stream form, Reco
FormContentType contentType = recognizeOptions.ContentType ?? DetectContentType(form, nameof(form));

ResponseWithHeaders<ServiceAnalyzeLayoutAsyncHeaders> response = ServiceClient.AnalyzeLayoutAsync(contentType, form, cancellationToken);
return new RecognizeContentOperation(ServiceClient, Diagnostics,response.Headers.OperationLocation);
return new RecognizeContentOperation(ServiceClient, Diagnostics, response.Headers.OperationLocation);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ private async ValueTask<Response> UpdateStatusAsync(bool async, CancellationToke

if (update.Value.Status == OperationStatus.Succeeded)
{
// we need to first assign a vaue and then mark the operation as completed to avoid race conditions
// We need to first assign a value and then mark the operation as completed to avoid a race condition with the getter in Value
_value = ConvertToRecognizedForms(update.Value.AnalyzeResult);
_hasCompleted = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private async ValueTask<Response> UpdateStatusAsync(bool async, CancellationToke

if (update.Value.Status == OperationStatus.Succeeded)
{
// we need to first assign a vaue and then mark the operation as completed to avoid race conditions
// We need to first assign a value and then mark the operation as completed to avoid a race condition with the getter in Value
_value = ConvertToRecognizedReceipts(update.Value.AnalyzeResult);
_hasCompleted = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private async ValueTask<Response> UpdateStatusAsync(bool async, CancellationToke

if (update.Value.ModelInfo.Status == CustomFormModelStatus.Ready)
{
// we need to first assign a vaue and then mark the operation as completed to avoid race conditions
// We need to first assign a value and then mark the operation as completed to avoid a race condition with the getter in Value
_value = new CustomFormModel(update.Value);
_hasCompleted = true;
}
Expand Down

0 comments on commit fc1806f

Please sign in to comment.