Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Changes
Page history
Updated Pseudo Code (markdown)
authored
Apr 15, 2017
by
LIU Hao
Show whitespace changes
Inline
Side-by-side
Pseudo-Code.md
View page @
c2a3e03c
...
@@ -312,12 +312,12 @@ Wakes up another thread that is sleeping because of `RELEASE_KEYED_EVENT(key, ti
...
@@ -312,12 +312,12 @@ Wakes up another thread that is sleeping because of `RELEASE_KEYED_EVENT(key, ti
pOnceFlag->bLocked = true;
pOnceFlag->bLocked = true;
return _MCFCRT_kOnceResultInitial;
return _MCFCRT_kOnceResultInitial;
}
}
// Once flags don't support spinning to simplify their design.
// Tell another thread which is going to unlock this once flag that there
// Tell another thread which is going to unlock this once flag that there
// is a new waiter by incrementing the number of threads trapped.
// is a new waiter by incrementing the number of threads trapped.
// Note all this requires that there MUST be such a thread (in other
// Note all this requires that there MUST be such a thread (in other
// words, the once flag must have been locked), otherwise we get a deadlock
// words, the once flag must have been locked), otherwise we get a deadlock
// in this thread.
// in this thread.
// Note once flags don't support spinning to simplify their design.
pOnceFlag->uThreadsTrapped += 1;
pOnceFlag->uThreadsTrapped += 1;
}
}
NTSTATUS lStatus = WAIT_FOR_KEYED_EVENT(pOnceFlag, u64UntilFastMonoClock);
NTSTATUS lStatus = WAIT_FOR_KEYED_EVENT(pOnceFlag, u64UntilFastMonoClock);
...
...
...
...