Back to index

lightning-sunbird  0.9+nobinonly
Functions
btsem.c File Reference
#include <kernel/OS.h>
#include "primpl.h"

Go to the source code of this file.

Functions

 PR_NewSem (PRUintn value)
 PR_DestroySem (PRSemaphore *sem)
 PR_WaitSem (PRSemaphore *sem)
 PR_PostSem (PRSemaphore *sem)
 PR_GetValueSem (PRSemaphore *sem)

Function Documentation

Definition at line 67 of file btsem.c.

{
       status_t result;

       PR_ASSERT(sem != NULL);
       result = delete_sem(sem->sem);
       PR_ASSERT(result == B_NO_ERROR);
       PR_DELETE(sem);
} 

Here is the caller graph for this function:

Definition at line 123 of file btsem.c.

{
       sem_info      info;

       PR_ASSERT(sem != NULL);
       get_sem_info(sem->sem, &info);
       return info.count;
}
PR_NewSem ( PRUintn  value)

Definition at line 46 of file btsem.c.

{
       PRSemaphore *semaphore;

       if (!_pr_initialized) _PR_ImplicitInitialization();

       semaphore = PR_NEWZAP(PRSemaphore);
       if (NULL != semaphore) {
              if ((semaphore->sem = create_sem(value, "nspr_sem")) < B_NO_ERROR)
                     return NULL;
              else 
                     return semaphore;
       }
       return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PR_PostSem ( PRSemaphore sem)

Definition at line 107 of file btsem.c.

{
       status_t result;

       PR_ASSERT(sem != NULL);
       result = release_sem_etc(sem->sem, 1, B_DO_NOT_RESCHEDULE);
       PR_ASSERT(result == B_NO_ERROR);
}

Here is the caller graph for this function:

PR_WaitSem ( PRSemaphore sem)

Definition at line 92 of file btsem.c.

{
       PR_ASSERT(sem != NULL);
       if (acquire_sem(sem->sem) == B_NO_ERROR)
              return PR_SUCCESS;
       else
              return PR_FAILURE;
}

Here is the caller graph for this function: