From 08e2916eb07fb75b2907032e2418316bf980d945 Mon Sep 17 00:00:00 2001
From: rpj
int sem_wait(sem_t * sem);
-int sem_timedwait(sem_t * sem, -const struct timespec *abstime); +
int sem_timedwait(sem_t * sem, const struct +timespec *abstime);
int sem_trywait(sem_t * sem);
int sem_post(sem_t * sem);
-int sem_post_multiple(sem_t * sem, int -number); +
int sem_post_multiple(sem_t * sem, int +number);
int sem_getvalue(sem_t * sem, int * sval);
@@ -56,8 +56,8 @@ if pshared is not zero.sem_wait atomically decrements sem's count if it is greater than 0 and returns immediately or it suspends the calling -thread until it can resume following a call to sem_post -or sem_post_multiple.
+thread until it can resume following a call to sem_post or +sem_post_multiple.sem_timedwait atomically decrements sem's count if it is greater than 0 and returns immediately, or it suspends the calling thread. If abstime time arrives before the thread can @@ -65,31 +65,29 @@ resume following a call to sem_post or sem_post_multiple, then sem_timedwait returns with a return code of -1 after having set errno to ETIMEDOUT. If the call can return without suspending then abstime is not checked.
-sem_trywait atomically -decrements sem's count if it is greater than 0 and returns -immediately, or it returns immediately with a return code of -1 after -having set errno to EAGAIN. sem_trywait -never blocks.
+sem_trywait atomically decrements sem's count if it +is greater than 0 and returns immediately, or it returns immediately +with a return code of -1 after having set errno to EAGAIN. +sem_trywait never blocks.
sem_post either releases one thread if there are any waiting on sem, or it atomically increments sem's count.
sem_post_multiple either releases multiple threads if there -are any waiting on sem and/or -it atomically increases sem's count. If there are -currently n waiters, where n the largest number less -than or equal to number, then n waiters are released -and sem's count is incremented by number minus n.
+are any waiting on sem and/or it atomically increases sem's +count. If there are currently n waiters, where n the +largest number less than or equal to number, then n +waiters are released and sem's count is incremented by number +minus n.sem_getvalue stores in the location pointed to by sval the current count of the semaphore sem. In the Pthreads-w32 implementation: if the value returned in sval is greater than or equal to 0 it was the sem's count at some point during the -call to sem_getvalue. If the -value returned in sval is less than 0 then it's absolute value -represents the number of threads waiting on sem at some point -during the call to sem_getvalue. POSIX -does not require an implementation of sem_getvalue +call to sem_getvalue. If the value returned in sval is +less than 0 then it's absolute value represents the number of threads +waiting on sem at some point during the call to sem_getvalue. +POSIX does not require an implementation of sem_getvalue to return a value in sval that is less than 0, but if it does -then it's absolute value must represent the number of waiters.
+then it's absolute value must represent the number of waiters.sem_destroy destroys a semaphore object, freeing the resources it might hold. No threads should be waiting on the semaphore at the time sem_destroy is called.
@@ -110,12 +108,12 @@ codes on error:+pshared is not zeroThe sem_timedwait function sets errno to the @@ -126,7 +124,7 @@ following error code on error:
ETIMEDOUT -+if abstime arrives before the waiting thread can resume following a call to sem_post or sem_post_multiple.@@ -138,7 +136,7 @@ error code on error:EAGAIN -+if the semaphore count is currently 0The sem_post and sem_post_multiple functions set @@ -149,8 +147,8 @@ if the semaphore count is currently 0
ERANGE if after incrementing, the semaphore count would exceed - _POSIX_SEM_VALUE_MAX (the semaphore count is left unchanged - in this case) + SEM_VALUE_MAX (the semaphore count is left unchanged in this + case) @@ -199,4 +197,4 @@ error code on error: