Changeset 573 for trunk/libs/libsemaphore
- Timestamp:
- Oct 5, 2018, 12:21:52 AM (6 years ago)
- Location:
- trunk/libs/libsemaphore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libs/libsemaphore/semaphore.c
r469 r573 1 1 /* 2 * pthread.c - User leve <semaphore> library implementation.2 * pthread.c - User level <semaphore> library implementation. 3 3 * 4 4 * Author Alain Greiner (2016,2017,2018) -
trunk/libs/libsemaphore/semaphore.h
r469 r573 2 2 * pthread.h - User level <semaphore> library definition. 3 3 * 4 * Author Alain Greiner (2016,2017 )4 * Author Alain Greiner (2016,2017,2018) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 33 33 /********************************************************************************************* 34 34 * This function initializes an unnamed semaphore. 35 * Process shared semaphores are not supported in this implementation.36 35 * Initializing a semaphore that has already been initialized results in undefined behavior. 37 36 ********************************************************************************************* … … 46 45 47 46 /********************************************************************************************* 48 * This blocking function locks a semaphore. It decrements the semaphore pointed to by <sem>.47 * This blocking function takes a semaphore. It decrements the semaphore pointed to by <sem>. 49 48 * If the semaphore's value is greater than zero, then the decrement proceeds, and the 50 * function returns immediately. If the semaphore currently has the value zero, then the call 51 * blocks until it becomes possible to perform the decrement. 49 * function returns immediately. If the semaphore currently has the value zero, the calling 50 * thread registers in the associated waiting queue, blocks and deschedules. 51 * It will be unblocked by another thread when it becomes possible to perform the decrement. 52 52 ********************************************************************************************* 53 53 * @ sem : [in] pointer on semaphore. … … 57 57 58 58 /********************************************************************************************* 59 * This function unlocks a semaphore. It increments the semaphore pointed to by <sem>.59 * This function releases a semaphore. It increments the semaphore pointed to by <sem>. 60 60 * If the semaphore's value consequently becomes greater than zero, then another thread 61 * blocked in a sem_wait() call will be woken up and proceed to lockthe semaphore.61 * blocked in a sem_wait() call will be woken up to try to take the semaphore. 62 62 ********************************************************************************************* 63 63 * @ sem : [in] pointer on semaphore.
Note: See TracChangeset
for help on using the changeset viewer.