mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-15 08:53:07 +09:00
Clean up control flow in WaitableEvent.
This commit is contained in:
parent
9759098329
commit
68639a9347
1 changed files with 7 additions and 8 deletions
|
|
@ -90,15 +90,14 @@ class SyncWaiter : public WaitableEvent::Waiter {
|
|||
}
|
||||
|
||||
bool Fire(WaitableEvent *signaling_event) {
|
||||
lock_->Acquire();
|
||||
const bool previous_value = fired_;
|
||||
fired_ = true;
|
||||
if (!previous_value)
|
||||
signaling_event_ = signaling_event;
|
||||
lock_->Release();
|
||||
AutoLock locked(*lock_);
|
||||
|
||||
if (previous_value)
|
||||
if (fired_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
fired_ = true;
|
||||
signaling_event_ = signaling_event;
|
||||
|
||||
cv_->Broadcast();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue