Common: Polish Fiber class, add comments, asserts and more tests.
This commit is contained in:
parent
8d0e3c5422
commit
be320a9e10
5 changed files with 147 additions and 25 deletions
|
@ -43,4 +43,11 @@ void SpinLock::unlock() {
|
|||
lck.clear(std::memory_order_release);
|
||||
}
|
||||
|
||||
bool SpinLock::try_lock() {
|
||||
if (lck.test_and_set(std::memory_order_acquire)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace Common
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue