File tree 2 files changed +4
-5
lines changed
aws-cpp-sdk-transfer/source/transfer 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -229,6 +229,7 @@ namespace Aws
229
229
230
230
if (IsTransitionAllowed (currentStatus, value))
231
231
{
232
+ std::unique_lock<std::mutex> semaphoreLock (m_statusLock);
232
233
m_status.store (static_cast <long >(value));
233
234
234
235
if (IsFinishedStatus (value))
@@ -238,20 +239,18 @@ namespace Aws
238
239
CleanupDownloadStream ();
239
240
}
240
241
241
- std::unique_lock<std::mutex> semaphoreLock (m_statusLock);
242
242
m_waitUntilFinishedSignal.notify_all ();
243
243
}
244
244
}
245
245
}
246
246
247
247
void TransferHandle::WaitUntilFinished () const
248
248
{
249
+ std::unique_lock<std::mutex> semaphoreLock (m_statusLock);
249
250
if (!IsFinishedStatus (static_cast <TransferStatus>(m_status.load ())) || HasPendingParts ())
250
251
{
251
- std::unique_lock<std::mutex> semaphoreLock (m_statusLock);
252
252
m_waitUntilFinishedSignal.wait (semaphoreLock, [this ]()
253
253
{ return IsFinishedStatus (static_cast <TransferStatus>(m_status.load ())) && !HasPendingParts (); });
254
- semaphoreLock.unlock ();
255
254
}
256
255
}
257
256
@@ -301,4 +300,4 @@ namespace Aws
301
300
}
302
301
}
303
302
}
304
- }
303
+ }
Original file line number Diff line number Diff line change @@ -501,9 +501,9 @@ namespace Aws
501
501
}
502
502
else
503
503
{
504
- transferContext->handle ->UpdateStatus (DetermineIfFailedOrCanceled (*transferContext->handle ));
505
504
transferContext->handle ->ChangePartToFailed (transferContext->partState );
506
505
transferContext->handle ->SetError (outcome.GetError ());
506
+ transferContext->handle ->UpdateStatus (DetermineIfFailedOrCanceled (*transferContext->handle ));
507
507
TriggerErrorCallback (*transferContext->handle , outcome.GetError ());
508
508
}
509
509
You can’t perform that action at this time.
0 commit comments