Lines Matching defs:value
48 // 31-bit signed value and a 1-bit 'shared' flag
51 // We use the value -1 to indicate contention on the
53 // any value lower than -2 is invalid at runtime.
72 // Convert a value into the corresponding sem->count bit pattern.
75 // Convert a sem->count bit pattern into the corresponding signed value.
80 // The value +1 as a sem->count bit-pattern.
83 // The value -1 as a sem->count bit-pattern.
104 int sem_init(sem_t* sem, int pshared, unsigned int value) {
105 // Ensure that 'value' can be stored in the semaphore.
106 if (value > SEM_VALUE_MAX) {
111 unsigned int count = SEMCOUNT_FROM_VALUE(value);
140 // Decrement a semaphore's value atomically,
142 // this returns immediately if the value is
163 // value is already negative *or* 0. Returns the old value.
182 // "Increment" the value of a semaphore atomically and
183 // return its old value. Note that this implements
185 // value to +1 directly.
187 // NOTE: The value will _not_ wrap above SEM_VALUE_MAX
238 // before checking the timeout value. Note that if the
239 // value is currently 0, __sem_trydec() does nothing.
254 // Try to grab the semaphore. If the value was 0, this will also change it to -1.