Public Methods | |
| SpinLock () | |
| bool | AttemptLock (unsigned i_spin_count=GetDefaultSpinCount()) |
| void | MustLock () |
| LONG | ReleaseLock () |
| LONG | MarkForWakeup () |
Public Attributes | |
| volatile LONG | m_value |
|
|
|
|
|
AttemptLock will attempt to attain a lock after a said number of spins.
|
|
|
MarkForWakeup will increment the m_value value which will contain the number of threads that are waiting for a lock. If the value returned is "1", it indicates that this thread has actually aquired the lock instead of simply marking a wake-up. If the thread count is greater than 1, the caller MUST wait on the semaphore. |
|
|
MustLock will spin forever to attain the lock. This must only be used in cases where a spinlock will be held for a very short time. This will yield the cpu when attempting
|
|
|
ReleaseLock will release the given lock. It the value returned is not zero, then there are threads that are marked for wake-up. These threads |
|
|
|
Generated for Austria by
and
MakeXS at Sun Oct 24 17:35:34 PDT 2004