Show
Ignore:
Timestamp:
08/14/08 20:28:28 (6 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1218745708 +0000
git-parent:

[08d383c97946240fb812429befe015cea25929a3]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1218745708 +0000
Message:

document noit_sem.h, refs #39

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/utils/noit_sem.h

    r9a02263 rcd619cc  
    4444} noit_sem_t; 
    4545 
     46/*! \fn int noit_sem_init(noit_sem_t *s, int unused, int value) 
     47    \brief initializes a counting semaphore for first time use. 
     48    \param s the semaphore to be initialized 
     49    \param unused is unused (keeps API combatibility with sem_init() 
     50    \param value sets the initial value of the semaphore 
     51    \return 0 on success or -1 on failure 
     52 */ 
    4653API_EXPORT(int)  noit_sem_init(noit_sem_t *, int, int); 
     54/*! \fn int noit_sem_wait(noit_sem_t *s) 
     55    \brief decrements the value of the semaphore waiting if required. 
     56    \param s the semaphore on which to wait 
     57    \return 0 on success or -1 on failure 
     58 */ 
    4759API_EXPORT(int)  noit_sem_wait(noit_sem_t *); 
     60/*! \fn int noit_sem_post(noit_sem_t *s) 
     61    \brief increments the value of the semaphore releasing any waiters. 
     62    \param s the semaphore on which to wait 
     63    \return 0 on success or -1 on failure 
     64 */ 
    4865API_EXPORT(void) noit_sem_post(noit_sem_t *); 
     66/*! \fn int noit_sem_trywait(noit_sem_t *s) 
     67    \brief decrements the value of the semaphore if greater than 0 or fails 
     68    \param s the semaphore on which to wait 
     69    \return 0 on success or -1 on failure 
     70 */ 
    4971API_EXPORT(int)  noit_sem_trywait(noit_sem_t *); 
     72/*! \fn int noit_sem_getvalue(noit_sem_t *s, int *value) 
     73    \brief retrieves the current value of a semaphore, placing it in *value 
     74    \param s the semaphore on which to operate 
     75    \param value a pointer an integer that will be populated with the current value of the semaphore 
     76    \return 0 on success or -1 on failure 
     77 */ 
    5078API_EXPORT(int)  noit_sem_getvalue(noit_sem_t *, int *); 
     79/*! \fn int noit_sem_destroy(noit_sem_t *s) 
     80    \brief releases all resources related to a semaphore 
     81    \param s the semaphore to destroy 
     82    \return 0 on success or -1 on failure 
     83 */ 
    5184API_EXPORT(void) noit_sem_destroy(noit_sem_t *); 
    5285