Go to the SVN repository for this file.
34 # include <sys/syscall.h> 36 # include <linux/futex.h> 48 intres = syscall(SYS_futex, &
m_Value, FUTEX_WAIT, old_value,
NULL,
NULL, 0);
67 intres = syscall(SYS_futex, &
m_Value, FUTEX_WAIT, old_value, &left_time,
NULL, 0);
85 if(spent_time >= timeout)
88left_time -= spent_time;
101 returnsyscall(SYS_futex, &
m_Value, FUTEX_WAKE, cnt_to_wake,
NULL,
NULL, 0);
EWaitResult WaitValueChange(int old_value)
Wait for futex's value to change (with and without timeout).
volatile int m_Value
Value of the futex.
int GetValue(void)
Read value of the futex.
EWaitResult
Type of result returned from WaitValueChange()
@ eWaitWokenUp
Thread was woken up by call to WakeUpWaiters() from another thread.
@ eValueChanged
Futex's value was changed in another thread before waiting was started.
@ eTimedOut
Method returned because total waiting time exceeded given timeout.
int WakeUpWaiters(int cnt_to_wake)
Wake up some threads waiting on this futex.
int AddValue(int cnt_to_add)
Atomically add some amount to futex's value.
void Unlock(void)
Unlock the mutex.
void Lock(void)
Lock the mutex.
CFutex m_Futex
Futex which is used as base for mutex implementation.
Class incorporating convenient methods to work with struct timespec.
static CSrvTime Current(void)
Exact current time with precision up to nanoseconds.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4