| Enumerator |
|---|
| CLOD_RWSEQ_OK | No worries at all!
|
| CLOD_RWSEQ_MISUSE | An invalid operation was attempted (e.g. releasing without prior acquisition), and the detection of the validity of the operation is only incidentally effective. Put another way, every return of this value is a lucky coincidence that may have prevented silent data loss, and other cases of the same misuse may not be so lucky. Notably, the misuse may also be on behalf of a different thread or process.
|
| CLOD_RWSEQ_OTHER | An error which is reasonably assumed to never happen happened. Examples include the system clock being unavailable, or a critical internal bug that causes an invalid pointer to be passed to a syscall.
|
| CLOD_RWSEQ_DEAD_ACQUIRED | The lock was acquired from a previous dead write lock holder. The lock made no progress over a period greater than the dead lock timeout threshold, and the lock was forcibly acquired from a dead write lock holder. Upon this return value, the data the lock was protecting may have been left in an inconsistent state by the previous write lock holder. The method must then either restore the data and cleanly release the lock, or abort without releasing the lock. It is valid to refresh the lock in this state. It is only returned by write lock acquisition methods. Read lock acquisition methods instead return CLOD_RWSEQ_DEAD.
|
| CLOD_RWSEQ_DEAD | The lock made no progress over a period greater than the dead lock timeout threshold. Methods are strongly encouraged to attempt to fix the data the lock protects and the lock itself following this return value. Otherwise, subsequent read lock acquiring methods will also spend the timeout threshold waiting on the same dead lock - a potential avenue for unacceptable performance. This would entail acquiring the write lock instead, as fixing the
|
| CLOD_RWSEQ_INTERRUPTED | The lock was lost at some point before this return value. The operation was interrupted by an acquisition; Two threads thought they held a lock at the same time. In normal operation this is only returned by clod_rwseq_ro_unlock, as the read-only lock cannot block a writer from acquiring a lock. Other methods only return this if they have been kicked out by an acquirer that thought they were dead. Such a case opens up the possibility for multiple writers to think they hold a lock at the same time. This needs to be addressed by increasing the dead lock timeout threshold and/or the cadence with which the slow lock holder refreshes its lock. It may also be returned if the provided sequence is incorrect.
|