Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/chen3feng/toft
/ TryLock
Method
TryLock
system/threading/spinlock.cpp:30–38 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
28
}
29
30
bool SpinLock::TryLock()
31
{
32
if (TOFT_CHECK_PTHREAD_TRYLOCK_ERROR(pthread_spin_trylock(&m_lock)))
33
{
34
m_owner = ThisThread::GetId();
35
return true;
36
}
37
return false;
38
}
39
40
void SpinLock::Unlock()
41
{
Callers
1
ScopedTryLocker
Method · 0.45
Calls
no outgoing calls
Tested by
no test coverage detected