#include <ngc/core/ngcbSched.h>Macros | |
| #define | _GNU_SOURCE |
| #define | _REENTRANT |
Functions | |
| int | ngcbSemInit (ngcb_sema_t *sp, unsigned int count, int type, void *arg) |
| int | ngcbSemDestroy (ngcb_sema_t *sp) |
| int | ngcbSemLock (ngcb_sema_t *sp) |
| int | ngcbSemUnlock (ngcb_sema_t *sp) |
| int | ngcbSemTryLock (ngcb_sema_t *sp) |
| int | ngcbSemPost (ngcb_sema_t *sp) |
| int | ngcbSemSet (ngcb_sema_t *sp, unsigned int cnt) |
| int | ngcbSemWait (ngcb_sema_t *sp) |
| size_t | ngcbSemWaitCnt (ngcb_sema_t *sp, size_t cnt) |
| int | ngcbSemWaitAbsTime (ngcb_sema_t *sp, ngcb_abstime_t *absTime) |
| int | ngcbSemTryWait (ngcb_sema_t *sp) |
| size_t | ngcbSemCnt (ngcb_sema_t *sp) |
| int | ngcbRwLockInit (ngcb_lock_t *rwlp, int type, void *arg) |
| int | ngcbRwLockDestroy (ngcb_lock_t *rwlp) |
| int | ngcbRwRdLock (ngcb_lock_t *rwlp) |
| int | ngcbRwTryRdLock (ngcb_lock_t *rwlp) |
| int | ngcbRwWrLock (ngcb_lock_t *rwlp) |
| int | ngcbRwTryWrLock (ngcb_lock_t *rwlp) |
| int | ngcbRwUnlock (ngcb_lock_t *rwlp) |
| #define _GNU_SOURCE |
| #define _REENTRANT |
| int ngcbRwLockDestroy | ( | ngcb_lock_t * | rwlp | ) |
Destroy a readers/writer lock pointed to by rwlp.
| int ngcbRwLockInit | ( | ngcb_lock_t * | rwlp, |
| int | type, | ||
| void * | arg ) |
Initialize a new readers/writer lock.
| int ngcbRwRdLock | ( | ngcb_lock_t * | rwlp | ) |
Get a read lock on the readers/writer lock pointed to by rwlp. If the readers/writer lock is currently locked for writing, the calling thread blocks until the write lock is freed. Multiple threads may simultaneously hold a read lock on a readers/writer lock.
| int ngcbRwTryRdLock | ( | ngcb_lock_t * | rwlp | ) |
Try to get a read lock on the readers/writer lock pointed to by rwlp. If the readers/writer lock is locked for writing, it returns (-1). Otherwise, the read lock is acquired.
| int ngcbRwTryWrLock | ( | ngcb_lock_t * | rwlp | ) |
Try to get a write lock on the readers/writer lock pointed to by rwlp. If the readers/writer lock is currently locked for reading or writing, it returns (-1).
| int ngcbRwUnlock | ( | ngcb_lock_t * | rwlp | ) |
Unlock a readers/writer lock pointed to by rwlp. If the readers/writer lock is currently locked for writing, the write-lock is released and all suspended readers or writers are unlocked. If the readers/writer lock is currently locked for reading then the number of readers is decremented. When the number of readers becomes zero the read-lock is released and one of the other threads that is waiting for the readers/writer lock will be unblocked.
| int ngcbRwWrLock | ( | ngcb_lock_t * | rwlp | ) |
Get a write lock on the readers/writer lock pointed to by rwlp. If the readers/writer lock is currently locked for reading or writing, the calling thread blocks until all the read/write locks are freed. At any given time, only one thread may have a write lock on a readers/writer lock.
| size_t ngcbSemCnt | ( | ngcb_sema_t * | sp | ) |
Return the current counter value of the specified semaphore.
| int ngcbSemDestroy | ( | ngcb_sema_t * | sp | ) |
Destroy the specified semphore.
| int ngcbSemInit | ( | ngcb_sema_t * | sp, |
| unsigned int | count, | ||
| int | type, | ||
| void * | arg ) |
Create a new counting semaphore. The count specifies the initial semaphore counter value. Depending on the value of type either a fast (ngcbSEM_FAST) or a checked (ngcbSEM_CHECKED) semaphore will be created.
| int ngcbSemLock | ( | ngcb_sema_t * | sp | ) |
Acquire the fast lock associated with the semaphore. The function will block until the lock is available or an error occured (if error checking is requested).
| int ngcbSemPost | ( | ngcb_sema_t * | sp | ) |
Increment the semaphore counter for the specified semaphore.
| int ngcbSemSet | ( | ngcb_sema_t * | sp, |
| unsigned int | cnt ) |
Set the semaphore counter for the specified semaphore.
| int ngcbSemTryLock | ( | ngcb_sema_t * | sp | ) |
Try to get the fast lock associated with the semaphore. If the lock is not available, the function returns (-1). Otherwise the lock is acquired and zero is returned.
| int ngcbSemTryWait | ( | ngcb_sema_t * | sp | ) |
Decrement the semphore counter for the specified semaphore. If the counter was zero, the function returns (-1).
| int ngcbSemUnlock | ( | ngcb_sema_t * | sp | ) |
Release the fast lock associated with the semaphore.
| int ngcbSemWait | ( | ngcb_sema_t * | sp | ) |
Decrements the semphore counter for the specified semaphore. If the counter was zero, the calling process is suspended until the semaphore is posted.
| int ngcbSemWaitAbsTime | ( | ngcb_sema_t * | sp, |
| ngcb_abstime_t * | absTime ) |
Decrement the semphore counter for the specified semaphore. If the counter was zero, the calling process is suspended until either the semphore is posted or the given absolute time has been reached. When the semaphore counter is still zero the function returns (-1).
| size_t ngcbSemWaitCnt | ( | ngcb_sema_t * | sp, |
| size_t | cnt ) |
Suspend the calling process until the semaphore counter value is equal to or greater than cnt. The function returns the actual semaphore counter value.