fix an issue of a possibility of race condition in unlocking mutex
This commit is contained in:
parent
8f6ff99136
commit
f0c4f893bd
@ -120,7 +120,8 @@ class Mutex::Lock {
|
||||
|
||||
~Lock() noexcept {
|
||||
// Ensure that the Sync's destructor is called on worker thread.
|
||||
ctx_->env().ExecSub(ctx_, [sync = sync_](){});
|
||||
ctx_->env().ExecSub(
|
||||
ctx_, [sync = std::move(sync_)]() mutable { sync = nullptr; });
|
||||
}
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user