Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
nssrwlk.h File Reference
#include "prtypes.h"
#include "nssrwlkt.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define NSS_RWLOCK_RANK_NONE   0

Functions

PR_BEGIN_EXTERN_C PR_EXTERN (NSSRWLock *) NSSRWLock_New(PRUint32 lock_rank
 nssRWLock_AtomicCreate (NSSRWLock **prwlock, PRUint32 lock_rank, const char *lock_name)
 PR_EXTERN (void) NSSRWLock_Destroy(NSSRWLock *lock)
 Sets SecurityCotext for proxy env.
 PR_EXTERN (PRBool) NSSRWLock_HaveWriteLock(NSSRWLock *rwlock)

Variables

PR_BEGIN_EXTERN_C const char * lock_name

Define Documentation

Definition at line 59 of file nssrwlk.h.


Function Documentation

nssRWLock_AtomicCreate ( NSSRWLock **  prwlock,
PRUint32  lock_rank,
const char *  lock_name 
)

Definition at line 178 of file nssrwlk.c.

{
    NSSRWLock  *    rwlock;
    static PRInt32  initializers;

    PR_ASSERT(prwlock != NULL);

    /* atomically initialize the lock */
    while (NULL == (rwlock = *prwlock)) {
        PRInt32 myAttempt = PR_AtomicIncrement(&initializers);
        if (myAttempt == 1) {
            if (NULL == (rwlock = *prwlock)) {
                *prwlock = rwlock = NSSRWLock_New(lock_rank, lock_name);
            }
            (void) PR_AtomicDecrement(&initializers);
            break;
        }
        PR_Sleep(PR_INTERVAL_NO_WAIT);          /* PR_Yield() */
        (void) PR_AtomicDecrement(&initializers);
    }

    return rwlock;
}
PR_BEGIN_EXTERN_C PR_EXTERN ( NSSRWLock *  )
PR_EXTERN ( void  )

Sets SecurityCotext for proxy env.

Sets SecurityCotext for proxy env.

  1. the array to sort
    1. the number of elements in the array
    2. the size of each array element
    3. comparison function taking two elements and parameter #5 and returning an integer:
      • less than zero if the first element should be before the second
      • 0 if the order of the elements does not matter
      • greater than zero if the second element should be before the first
    4. extra data to pass to comparison function

Definition at line 972 of file irix.c.

{
PRThread *me = _PR_MD_CURRENT_THREAD();

       /*
        * the exit code of the process is the exit code of the primordial
        * sproc
        */
       if (!_PR_IS_NATIVE_THREAD(me) && (_PR_MD_CURRENT_CPU()->id == 0)) {
              /*
               * primordial sproc case: call _exit directly
               * Cause SIGKILL to be sent to other sprocs
               */
              prctl(PR_SETEXITSIG, SIGKILL);
              _exit(status);
       } else {
              int rv;
              char data;
              sigset_t set;

              /*
               * non-primordial sproc case: cause the primordial sproc, cpu 0,
               * to wakeup and call _exit
               */
              _pr_irix_process_exit = 1;
              _pr_irix_process_exit_code = status;
              rv = write(_pr_irix_primoridal_cpu_fd[1], &data, 1);
              PR_ASSERT(rv == 1);
              /*
               * block all signals and wait for SIGKILL to terminate this sproc
               */
              sigfillset(&set);
              sigsuspend(&set);
              /*
               * this code doesn't (shouldn't) execute
               */
              prctl(PR_SETEXITSIG, SIGKILL);
              _exit(status);
       }
}

Variable Documentation

Definition at line 76 of file nssrwlk.h.