75 Thread::YieldThread();
86 ThreadId threadId = Thread::GetMyThreadId();
89 if (threadId == this->
lock)
95 Thread::YieldThread();
119 this->
lock =
nullptr;
void Lock()
Lock.
Definition spinlock.h:83
Spinlock()
Constructor.
Definition spinlock.h:43
volatile Threading::ThreadId lock
Definition spinlock.h:36
~Spinlock()
Destructor.
Definition spinlock.h:52
void Unlock()
Unlock.
Definition spinlock.h:103
void operator=(Spinlock &&rhs)
Move operator.
Definition spinlock.h:63
#define n_assert(exp)
Definition debug.h:50
int Exchange(int volatile *dest, int value)
interlocked exchange
Definition gccinterlocked.cc:94
int CompareExchange(int volatile *dest, int exchange, int comparand)
interlocked compare-exchange
Definition gccinterlocked.cc:112
The Jobs2 system provides a set of threads and a pool of jobs from which threads can pickup work.
Definition jobs2.h:16
static const ThreadId InvalidThreadId
Definition linuxthreadid.h:16
pthread_t ThreadId
Definition linuxthreadid.h:15
int64_t ThreadIdStorage
Definition linuxthreadid.h:17
Definition spinlock.h:110
SpinlockScope(Threading::Spinlock *lock)
Definition spinlock.h:111
~SpinlockScope()
Definition spinlock.h:116
Threading::Spinlock * lock
Definition spinlock.h:122