Lines Matching defs:value
38 * 31-bit signed value and a 1-bit 'shared' flag
41 * We use the value -1 to indicate contention on the
43 * any value lower than -2 is invalid at runtime.
65 /* Maximum unsigned value that can be stored in the semaphore.
71 /* convert a value into the corresponding sem->count bit pattern */
74 /* convert a sem->count bit pattern into the corresponding signed value */
77 /* the value +1 as a sem->count bit-pattern. */
80 /* the value -1 as a sem->count bit-pattern. */
90 int sem_init(sem_t *sem, int pshared, unsigned int value)
97 /* ensure that 'value' can be stored in the semaphore */
98 if (value > SEM_MAX_VALUE) {
103 sem->count = SEMCOUNT_FROM_VALUE(value);
157 /* Decrement a semaphore's value atomically,
159 * this returns immediately if the value is
184 * value is already negative *or* 0. Returns the old value.
209 /* "Increment" the value of a semaphore atomically and
210 * return its old value. Note that this implements
212 * value to +1 directly.
214 * NOTE: The value will _not_ wrap above SEM_VALUE_MAX
278 * before checking the timeout value. Note that if the
279 * value is currently 0, __sem_trydec() does nothing.
316 /* Try to grab the semaphore. If the value was 0, this
381 * However, code that depends on this negative value to be
383 * only returns the semaphore value, which is 0, in case of