Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Enumerations | Functions | Variables
primpl.h File Reference
#include "nspr.h"
#include "prpriv.h"
#include "md/prosdep.h"
#include "obsolete/probslet.h"

Go to the source code of this file.

Classes

struct  _PRCPUQueue
struct  _PRCPU
struct  _PRInterruptTable
struct  PRLock
struct  PRCondVar
struct  PRMonitor
struct  PRSemaphore
struct  PRSem
struct  PRStackStr
struct  PRThreadStack
struct  PRThread
struct  PRThread::_wait
struct  PRProcessAttr
struct  PRProcess
struct  PRFileMap
struct  PRFilePrivate
struct  PRDir
struct  PRSegment
struct  PRSharedMemory
union  _PRCPU.u

Defines

#define _PR_CPU_PTR(_qp)   ((_PRCPU*) ((char*) (_qp) - offsetof(_PRCPU,links)))
#define _MD_GET_ATTACHED_THREAD()   (_PR_MD_CURRENT_THREAD())
#define _PR_INTSOFF(_is)
#define _PR_FAST_INTSON(_is)
#define _PR_INTSON(_is)
#define _PR_THREAD_LOCK(_thread)   _PR_MD_LOCK(&(_thread)->threadLock);
#define _PR_THREAD_UNLOCK(_thread)   _PR_MD_UNLOCK(&(_thread)->threadLock);
#define _PR_RUNQ_LOCK(_cpu)
#define _PR_RUNQ_UNLOCK(_cpu)
#define _PR_SLEEPQ_LOCK(_cpu)   _PR_MD_LOCK(&(_cpu)->queue->sleepQLock );
#define _PR_SLEEPQ_UNLOCK(_cpu)   _PR_MD_UNLOCK(&(_cpu)->queue->sleepQLock );
#define _PR_MISCQ_LOCK(_cpu)   _PR_MD_LOCK(&(_cpu)->queue->miscQLock );
#define _PR_MISCQ_UNLOCK(_cpu)   _PR_MD_UNLOCK(&(_cpu)->queue->miscQLock );
#define _PR_CPU_LIST_LOCK()   _PR_MD_LOCK(&_pr_cpuLock)
#define _PR_CPU_LIST_UNLOCK()   _PR_MD_UNLOCK(&_pr_cpuLock)
#define QUEUE_RUN   0x1
#define QUEUE_SLEEP   0x2
#define QUEUE_JOIN   0x4
#define QUEUE_SUSPEND   0x8
#define QUEUE_LOCK   0x10
#define _PR_ADD_RUNQ(_thread, _cpu, _pri)
#define _PR_DEL_RUNQ(_thread)
#define _PR_ADD_SLEEPQ(_thread, _timeout)
#define _PR_DEL_SLEEPQ(_thread, _propogate)
#define _PR_ADD_JOINQ(_thread, _cpu)
#define _PR_DEL_JOINQ(_thread)
#define _PR_ADD_SUSPENDQ(_thread, _cpu)
#define _PR_DEL_SUSPENDQ(_thread)
#define _PR_THREAD_SWITCH_CPU(_thread, _newCPU)   (_thread)->cpu = (_newCPU);
#define _PR_IS_NATIVE_THREAD(thread)   (thread->flags & _PR_GLOBAL_SCOPE)
#define _PR_IS_NATIVE_THREAD_SUPPORTED()   1
#define _PR_SET_RESCHED_FLAG()   _PR_MD_CURRENT_CPU()->u.missed[3] = 1
#define _PR_CLEAR_RESCHED_FLAG()   _PR_MD_CURRENT_CPU()->u.missed[3] = 0
#define _PR_MISSED_CLOCK   0x1
#define _PR_MISSED_IO   0x2
#define _PR_MISSED_CHILD   0x4
#define _PR_LOCK_LOCK(_lock)   _PR_MD_LOCK(&(_lock)->ilock);
#define _PR_LOCK_UNLOCK(_lock)   _PR_MD_UNLOCK(&(_lock)->ilock);
#define _PR_LOCK_PTR(_qp)   ((PRLock*) ((char*) (_qp) - offsetof(PRLock,links)))
#define _PR_CVAR_LOCK(_cvar)   _PR_MD_LOCK(&(_cvar)->ilock);
#define _PR_CVAR_UNLOCK(_cvar)   _PR_MD_UNLOCK(&(_cvar)->ilock);
#define _PR_SYSTEM   0x01
#define _PR_INTERRUPT   0x02
#define _PR_ATTACHED   0x04 /* created via PR_AttachThread */
#define _PR_PRIMORDIAL   0x08 /* the thread that called PR_Init */
#define _PR_ON_SLEEPQ   0x10 /* thread is on the sleepQ */
#define _PR_ON_PAUSEQ   0x20 /* thread is on the pauseQ */
#define _PR_SUSPENDING   0x40 /* thread wants to suspend */
#define _PR_GLOBAL_SCOPE   0x80 /* thread is global scope */
#define _PR_IDLE_THREAD   0x200 /* this is an idle thread */
#define _PR_GCABLE_THREAD   0x400 /* this is a collectable thread */
#define _PR_BOUND_THREAD   0x800 /* a bound thread */
#define _PR_INTERRUPT_BLOCKED   0x1000 /* interrupts blocked */
#define _PR_UNBORN   0
#define _PR_RUNNABLE   1
#define _PR_RUNNING   2
#define _PR_LOCK_WAIT   3
#define _PR_COND_WAIT   4
#define _PR_JOIN_WAIT   5
#define _PR_IO_WAIT   6
#define _PR_SUSPENDED   7
#define _PR_DEAD_STATE   8 /* for debugging */
#define _PR_STACK_VM   0x1 /* using vm instead of malloc */
#define _PR_STACK_MAPPED   0x2 /* vm is mapped */
#define _PR_STACK_PRIMORDIAL   0x4 /* stack for primordial thread */
#define _MD_MINIMUM_STACK_SIZE   0
#define _PR_ADJUST_STACKSIZE(stackSize)
#define _PR_IS_GCABLE_THREAD(thr)   ((thr)->flags & _PR_GCABLE_THREAD)
#define _PR_PENDING_INTERRUPT(thr)   (!((thr)->flags & _PR_INTERRUPT_BLOCKED) && ((thr)->flags & _PR_INTERRUPT))
#define _PR_THREAD_BLOCK_INTERRUPT(thr)   (thr->flags |= _PR_INTERRUPT_BLOCKED)
#define _PR_THREAD_UNBLOCK_INTERRUPT(thr)   (thr->flags &= ~_PR_INTERRUPT_BLOCKED)
#define _PR_THREAD_PTR(_qp)   ((PRThread*) ((char*) (_qp) - offsetof(PRThread,links)))
#define _PR_ACTIVE_THREAD_PTR(_qp)   ((PRThread*) ((char*) (_qp) - offsetof(PRThread,active)))
#define _PR_THREAD_CONDQ_PTR(_qp)   ((PRThread*) ((char*) (_qp) - offsetof(PRThread,waitQLinks)))
#define _PR_THREAD_MD_TO_PTR(_md)   ((PRThread*) ((char*) (_md) - offsetof(PRThread,md)))
#define _PR_THREAD_STACK_TO_PTR(_stack)   ((PRThread*) (_stack->thr))
#define _PR_ACTIVE_LOCAL_THREADQ()   _pr_active_local_threadQ
#define _PR_ACTIVE_GLOBAL_THREADQ()   _pr_active_global_threadQ
#define _PR_CPUQ()   _pr_cpuQ
#define _PR_RUNQ(_cpu)   ((_cpu)->queue->runQ)
#define _PR_RUNQREADYMASK(_cpu)   ((_cpu)->queue->runQReadyMask)
#define _PR_SLEEPQ(_cpu)   ((_cpu)->queue->sleepQ)
#define _PR_SLEEPQMAX(_cpu)   ((_cpu)->queue->sleepQmax)
#define _PR_PAUSEQ(_cpu)   ((_cpu)->queue->pauseQ)
#define _PR_SUSPENDQ(_cpu)   ((_cpu)->queue->suspendQ)
#define _PR_WAITINGTOJOINQ(_cpu)   ((_cpu)->queue->waitingToJoinQ)
#define _PR_DEADNATIVEQ   _pr_deadNativeQ
#define _PR_DEADUSERQ   _pr_deadUserQ
#define _PR_DEADQ_LOCK   PR_Lock(_pr_deadQLock);
#define _PR_DEADQ_UNLOCK   PR_Unlock(_pr_deadQLock);
#define _PR_INC_DEADNATIVE   (_pr_numNativeDead++)
#define _PR_DEC_DEADNATIVE   (_pr_numNativeDead--)
#define _PR_NUM_DEADNATIVE   (_pr_numNativeDead)
#define _PR_INC_DEADUSER   (_pr_numUserDead++)
#define _PR_DEC_DEADUSER   (_pr_numUserDead--)
#define _PR_NUM_DEADUSER   (_pr_numUserDead)
#define _PR_IO_PENDING(_thread)   ((_thread)->io_pending)
#define _PR_MD_INIT_CPUS   _MD_INIT_CPUS
#define _PR_MD_WAKEUP_CPUS   _MD_WAKEUP_CPUS
#define _PR_MD_START_INTERRUPTS   _MD_START_INTERRUPTS
#define _PR_MD_STOP_INTERRUPTS   _MD_STOP_INTERRUPTS
#define _PR_MD_ENABLE_CLOCK_INTERRUPTS   _MD_ENABLE_CLOCK_INTERRUPTS
#define _PR_MD_DISABLE_CLOCK_INTERRUPTS   _MD_DISABLE_CLOCK_INTERRUPTS
#define _PR_MD_BLOCK_CLOCK_INTERRUPTS   _MD_BLOCK_CLOCK_INTERRUPTS
#define _PR_MD_UNBLOCK_CLOCK_INTERRUPTS   _MD_UNBLOCK_CLOCK_INTERRUPTS
#define _PR_MD_WAIT   _MD_WAIT
#define _PR_MD_WAKEUP_WAITER   _MD_WAKEUP_WAITER
#define _PR_MD_CLOCK_INTERRUPT   _MD_CLOCK_INTERRUPT
#define _PR_MD_INIT_STACK   _MD_INIT_STACK
#define _PR_MD_CLEAR_STACK   _MD_CLEAR_STACK
#define _PR_MD_GET_INTSOFF   _MD_GET_INTSOFF
#define _PR_MD_SET_INTSOFF   _MD_SET_INTSOFF
#define _PR_MD_CURRENT_CPU   _MD_CURRENT_CPU
#define _PR_MD_SET_CURRENT_CPU   _MD_SET_CURRENT_CPU
#define _PR_MD_INIT_RUNNING_CPU   _MD_INIT_RUNNING_CPU
#define _PR_MD_PAUSE_CPU   _MD_PAUSE_CPU
#define _PR_MD_CLEANUP_BEFORE_EXIT   _MD_CLEANUP_BEFORE_EXIT
#define _PR_MD_EXIT   _MD_EXIT
#define _PR_MD_INIT_LOCKS   _MD_INIT_LOCKS
#define _PR_MD_NEW_LOCK   _MD_NEW_LOCK
#define _PR_MD_FREE_LOCK   _MD_FREE_LOCK
#define _PR_MD_LOCK   _MD_LOCK
#define _PR_MD_TEST_AND_LOCK   _MD_TEST_AND_LOCK
#define _PR_MD_UNLOCK   _MD_UNLOCK
#define _PR_MD_IOQ_LOCK   _MD_IOQ_LOCK
#define _PR_MD_IOQ_UNLOCK   _MD_IOQ_UNLOCK
#define _PR_MD_NEW_CV   _MD_NEW_CV
#define _PR_MD_FREE_CV   _MD_FREE_CV
#define _PR_MD_WAIT_CV   _MD_WAIT_CV
#define _PR_MD_NOTIFY_CV   _MD_NOTIFY_CV
#define _PR_MD_NOTIFYALL_CV   _MD_NOTIFYALL_CV
#define _PR_MD_CURRENT_THREAD   _MD_CURRENT_THREAD
#define _PR_MD_GET_ATTACHED_THREAD   _MD_GET_ATTACHED_THREAD
#define _PR_MD_LAST_THREAD   _MD_LAST_THREAD
#define _PR_MD_SET_CURRENT_THREAD   _MD_SET_CURRENT_THREAD
#define _PR_MD_SET_LAST_THREAD   _MD_SET_LAST_THREAD
#define _PR_MD_INIT_THREAD   _MD_INIT_THREAD
#define _PR_MD_EXIT_THREAD   _MD_EXIT_THREAD
#define _PR_MD_INIT_ATTACHED_THREAD   _MD_INIT_ATTACHED_THREAD
#define _PR_MD_SUSPEND_THREAD   _MD_SUSPEND_THREAD
#define _PR_MD_RESUME_THREAD   _MD_RESUME_THREAD
#define _PR_MD_SUSPEND_CPU   _MD_SUSPEND_CPU
#define _PR_MD_RESUME_CPU   _MD_RESUME_CPU
#define _PR_MD_BEGIN_SUSPEND_ALL   _MD_BEGIN_SUSPEND_ALL
#define _PR_MD_END_SUSPEND_ALL   _MD_END_SUSPEND_ALL
#define _PR_MD_BEGIN_RESUME_ALL   _MD_BEGIN_RESUME_ALL
#define _PR_MD_END_RESUME_ALL   _MD_END_RESUME_ALL
#define _PR_MD_CLEAN_THREAD   _MD_CLEAN_THREAD
#define _PR_MD_CREATE_THREAD   _MD_CREATE_THREAD
#define _PR_MD_JOIN_THREAD   _MD_JOIN_THREAD
#define _PR_MD_END_THREAD   _MD_END_THREAD
#define _PR_MD_YIELD   _MD_YIELD
#define _PR_MD_SET_PRIORITY   _MD_SET_PRIORITY
#define _PR_MD_SUSPENDALL   _MD_SUSPENDALL
#define _PR_MD_RESUMEALL   _MD_RESUMEALL
#define _PR_MD_INIT_CONTEXT   _MD_INIT_CONTEXT
#define _PR_MD_SWITCH_CONTEXT   _MD_SWITCH_CONTEXT
#define _PR_MD_RESTORE_CONTEXT   _MD_RESTORE_CONTEXT
#define _PR_MD_INIT_SEGS   _MD_INIT_SEGS
#define _PR_MD_ALLOC_SEGMENT   _MD_ALLOC_SEGMENT
#define _PR_MD_FREE_SEGMENT   _MD_FREE_SEGMENT
#define _PR_MD_OPEN_DIR   _MD_OPEN_DIR
#define _PR_MD_READ_DIR   _MD_READ_DIR
#define _PR_MD_CLOSE_DIR   _MD_CLOSE_DIR
#define _PR_MD_OPEN_SEMAPHORE   _MD_OPEN_SEMAPHORE
#define _PR_MD_WAIT_SEMAPHORE   _MD_WAIT_SEMAPHORE
#define _PR_MD_POST_SEMAPHORE   _MD_POST_SEMAPHORE
#define _PR_MD_CLOSE_SEMAPHORE   _MD_CLOSE_SEMAPHORE
#define _PR_MD_DELETE_SEMAPHORE   _MD_DELETE_SEMAPHORE
#define _PR_MD_INIT_FILEDESC   _MD_INIT_FILEDESC
#define _PR_MD_MAKE_NONBLOCK   _MD_MAKE_NONBLOCK
#define _PR_MD_OPEN   _MD_OPEN
#define _PR_MD_OPEN_FILE   _MD_OPEN_FILE
#define _PR_MD_CLOSE_FILE   _MD_CLOSE_FILE
#define _PR_MD_READ   _MD_READ
#define _PR_MD_WRITE   _MD_WRITE
#define _PR_MD_WRITEV   _MD_WRITEV
#define _PR_MD_FSYNC   _MD_FSYNC
#define _PR_MD_DELETE   _MD_DELETE
#define _PR_MD_RENAME   _MD_RENAME
#define _PR_MD_ACCESS   _MD_ACCESS
#define _PR_MD_STAT   _MD_STAT
#define _PR_MD_MKDIR   _MD_MKDIR
#define _PR_MD_MAKE_DIR   _MD_MAKE_DIR
#define _PR_MD_RMDIR   _MD_RMDIR
#define _PR_MD_INIT_IO   _MD_INIT_IO
#define _PR_MD_CLOSE_SOCKET   _MD_CLOSE_SOCKET
#define _PR_MD_CONNECT   _MD_CONNECT
#define _PR_MD_ACCEPT   _MD_ACCEPT
#define _PR_MD_BIND   _MD_BIND
#define _PR_MD_LISTEN   _MD_LISTEN
#define _PR_MD_SHUTDOWN   _MD_SHUTDOWN
#define _PR_MD_RECV   _MD_RECV
#define _PR_MD_SEND   _MD_SEND
#define _PR_MD_ACCEPT_READ   _MD_ACCEPT_READ
#define _PR_MD_SENDFILE   _MD_SENDFILE
#define _PR_MD_GETSOCKNAME   _MD_GETSOCKNAME
#define _PR_MD_GETPEERNAME   _MD_GETPEERNAME
#define _PR_MD_GETSOCKOPT   _MD_GETSOCKOPT
#define _PR_MD_SETSOCKOPT   _MD_SETSOCKOPT
#define _PR_MD_RECVFROM   _MD_RECVFROM
#define _PR_MD_SENDTO   _MD_SENDTO
#define _PR_MD_SOCKETPAIR   _MD_SOCKETPAIR
#define _PR_MD_SOCKET   _MD_SOCKET
#define _PR_MD_SOCKETAVAILABLE   _MD_SOCKETAVAILABLE
#define _PR_MD_PIPEAVAILABLE   _MD_PIPEAVAILABLE
#define _PR_MD_PR_POLL   _MD_PR_POLL
#define _PR_MD_INIT_FD_INHERITABLE   _MD_INIT_FD_INHERITABLE
#define _PR_MD_SET_FD_INHERITABLE   _MD_SET_FD_INHERITABLE
#define _PR_PROCESS_TIMEOUT_INTERRUPT_ERRORS(me)
#define _PR_MD_GET_SP   _MD_GET_SP
#define _PR_MD_LSEEK   _MD_LSEEK
#define _PR_MD_LSEEK64   _MD_LSEEK64
#define _PR_MD_GETFILEINFO   _MD_GETFILEINFO
#define _PR_MD_GETFILEINFO64   _MD_GETFILEINFO64
#define _PR_MD_GETOPENFILEINFO   _MD_GETOPENFILEINFO
#define _PR_MD_GETOPENFILEINFO64   _MD_GETOPENFILEINFO64
#define _PR_POLL_READ_SYS_READ   0x1
#define _PR_POLL_READ_SYS_WRITE   0x2
#define _PR_POLL_WRITE_SYS_READ   0x4
#define _PR_POLL_WRITE_SYS_WRITE   0x8
#define PR_NETADDR_SIZE(_addr)
#define _PR_FILEDESC_OPEN   0xaaaaaaaa /* 1010101... */
#define _PR_FILEDESC_CLOSED   0x55555555 /* 0101010... */
#define _PR_FILEDESC_FREED   0x11111111
#define _PR_SEG_VM   0x1
#define _PR_MD_EARLY_INIT   _MD_EARLY_INIT
#define _PR_MD_INTERVAL_INIT   _MD_INTERVAL_INIT
#define _PR_MD_FINAL_INIT   _MD_FINAL_INIT
#define _PR_MD_CREATE_PROCESS   _MD_CREATE_PROCESS
#define _PR_MD_DETACH_PROCESS   _MD_DETACH_PROCESS
#define _PR_MD_WAIT_PROCESS   _MD_WAIT_PROCESS
#define _PR_MD_KILL_PROCESS   _MD_KILL_PROCESS
#define _PR_MD_NOW   _MD_NOW
#define _PR_MD_GET_ENV   _MD_GET_ENV
#define _PR_MD_PUT_ENV   _MD_PUT_ENV
#define _PR_MD_INIT_ATOMIC   _MD_INIT_ATOMIC
#define _PR_MD_ATOMIC_INCREMENT   _MD_ATOMIC_INCREMENT
#define _PR_MD_ATOMIC_ADD   _MD_ATOMIC_ADD
#define _PR_MD_ATOMIC_DECREMENT   _MD_ATOMIC_DECREMENT
#define _PR_MD_ATOMIC_SET   _MD_ATOMIC_SET
#define _PR_MD_GET_INTERVAL   _MD_GET_INTERVAL
#define _PR_MD_INTERVAL_PER_SEC   _MD_INTERVAL_PER_SEC
#define _PR_MD_SETTHREADAFFINITYMASK   _MD_SETTHREADAFFINITYMASK
#define _PR_MD_GETTHREADAFFINITYMASK   _MD_GETTHREADAFFINITYMASK
#define _PR_MD_LOCKFILE   _MD_LOCKFILE
#define _PR_MD_TLOCKFILE   _MD_TLOCKFILE
#define _PR_MD_UNLOCKFILE   _MD_UNLOCKFILE
#define _PR_MD_CREATE_FILE_MAP   _MD_CREATE_FILE_MAP
#define _PR_MD_GET_MEM_MAP_ALIGNMENT   _MD_GET_MEM_MAP_ALIGNMENT
#define _PR_MD_MEM_MAP   _MD_MEM_MAP
#define _PR_MD_MEM_UNMAP   _MD_MEM_UNMAP
#define _PR_MD_CLOSE_FILE_MAP   _MD_CLOSE_FILE_MAP
#define _PR_SHM_IDENT   0xdeadbad
#define _PR_MD_OPEN_SHARED_MEMORY   _MD_OpenSharedMemory
#define _PR_MD_ATTACH_SHARED_MEMORY   _MD_AttachSharedMemory
#define _PR_MD_DETACH_SHARED_MEMORY   _MD_DetachSharedMemory
#define _PR_MD_CLOSE_SHARED_MEMORY   _MD_CloseSharedMemory
#define _PR_MD_DELETE_SHARED_MEMORY   _MD_DeleteSharedMemory
#define _PR_MD_OPEN_ANON_FILE_MAP   _md_OpenAnonFileMap
#define _PR_MD_EXPORT_FILE_MAP_AS_STRING   _md_ExportFileMapAsString
#define _PR_MD_IMPORT_FILE_MAP_FROM_STRING   _md_ImportFileMapFromString
#define PR_IPC_NAME_SIZE   1024
#define _PR_MD_GET_SOCKET_ERROR   _MD_GET_SOCKET_ERROR
#define _PR_MD_GETHOSTNAME   _MD_GETHOSTNAME
#define _PR_MD_GETSYSINFO   _MD_GETSYSINFO
#define _PR_MD_QUERY_FD_INHERITABLE   _MD_QUERY_FD_INHERITABLE
#define _PR_MD_GET_RANDOM_NOISE(buf, size)   _PR_MD_GetRandomNoise((buf),(size))

Typedefs

typedef struct PRSegment
typedef
typedefPR_BEGIN_EXTERN_C
struct 
_MDLock
typedef struct _MDCVar
typedef struct _MDSegment
typedef struct _MDThread
typedef struct _MDThreadStack
typedef struct _MDSemaphore
typedef struct _MDDir
typedef struct _MDFileDesc
typedef struct _MDProcess
typedef struct _MDFileMap
typedef struct _PRCPUQueue
typedef struct _PRCPU
typedef struct _MDCPU
typedef struct _PRInterruptTable _PRInterruptTable
typedef void(PR_CALLBACK_PRStartFn )(void *)

Enumerations

enum  _PRTriStateBool {
  _PR_TRI_TRUE = 1, _PR_TRI_FALSE = 0, _PR_TRI_UNKNOWN = -1, _PR_TRI_TRUE = 1,
  _PR_TRI_FALSE = 0, _PR_TRI_UNKNOWN = -1
}
enum  _PRIPCType { _PRIPCSem, _PRIPCShm }

Functions

 NSPR_API (void) PT_FPrintStats(PRFileDesc *fd
 Prototypes for machine dependent function implementations.
void _PR_IntsOn (_PRCPU *cpu)
void _PR_UnblockLockWaiter (PRLock *lock)
PRStatus _PR_WaitCondVar (PRThread *thread, PRCondVar *cvar, PRLock *lock, PRIntervalTime timeout)
PRUint32 _PR_CondVarToString (PRCondVar *cvar, char *buf, PRUint32 buflen)
void _PR_ClockInterrupt (void)
void _PR_Schedule (void)
void _PR_SetThreadPriority (PRThread *thread, PRThreadPriority priority)
PRSegment_PR_NewSegment (PRUint32 size, void *vaddr)
void _PR_DestroySegment (PRSegment *seg)
PRThreadStack_PR_NewStack (PRUint32 stackSize)
void _PR_FreeStack (PRThreadStack *stack)
PRBool _PR_NotifyThread (PRThread *thread, PRThread *me)
void _PR_NotifyLockedThread (PRThread *thread)
void _PR_AddThreadToRunQ (PRThread *me, PRThread *thread)
 NSPR_API (PRThread *) _PR_CreateThread(PRThreadType type
void _PR_NativeDestroyThread (PRThread *thread)
void _PR_UserDestroyThread (PRThread *thread)
PRThread_PRI_AttachThread (PRThreadType type, PRThreadPriority priority, PRThreadStack *stack, PRUint32 flags)
void _PRI_DetachThread (void)
PRStatus _PR_MD_WAIT (PRThread *, PRIntervalTime timeout)
PRStatus _PR_MD_WAKEUP_WAITER (PRThread *)
 NSPR_API (PRInt32) _PR_MD_GET_INTSOFF(void)
 NSPR_API (_PRCPU *) _PR_MD_CURRENT_CPU(void)
PRInt32 _PR_MD_PAUSE_CPU (PRIntervalTime timeout)
void _PR_MD_CLEANUP_BEFORE_EXIT (void)
void _PR_MD_EXIT (PRIntn status)
 NSPR_API (PRStatus) _PR_MD_NEW_LOCK(_MDLock *md)
 NSPR_API (PRIntn) _PR_MD_TEST_AND_LOCK(_MDLock *md)
PRStatus _PR_MD_INIT_THREAD (PRThread *thread)
void _PR_MD_EXIT_THREAD (PRThread *thread)
void _PR_MD_SUSPEND_THREAD (PRThread *thread)
void _PR_MD_RESUME_THREAD (PRThread *thread)
void _PR_MD_SUSPEND_CPU (_PRCPU *cpu)
void _PR_MD_RESUME_CPU (_PRCPU *cpu)
void _PR_MD_BEGIN_SUSPEND_ALL (void)
void _PR_MD_END_SUSPEND_ALL (void)
void _PR_MD_BEGIN_RESUME_ALL (void)
void _PR_MD_END_RESUME_ALL (void)
void _PR_MD_CLEAN_THREAD (PRThread *thread)
PRStatus _PR_MD_CREATE_THREAD (PRThread *thread, void(*start)(void *), PRThreadPriority priority, PRThreadScope scope, PRThreadState state, PRUint32 stackSize)
void _PR_MD_JOIN_THREAD (_MDThread *md)
void _PR_MD_END_THREAD (void)
void _PR_MD_YIELD (void)
void _PR_MD_SET_PRIORITY (_MDThread *md, PRThreadPriority newPri)
void _PR_MD_INIT_CONTEXT (PRThread *thread, char *top, void(*start)(void), PRBool *status)
void _PR_MD_SWITCH_CONTEXT (PRThread *thread)
void _PR_MD_RESTORE_CONTEXT (PRThread *thread)
void _PR_MD_INIT_SEGS (void)
PRStatus _PR_MD_ALLOC_SEGMENT (PRSegment *seg, PRUint32 size, void *vaddr)
void _PR_MD_FREE_SEGMENT (PRSegment *seg)
PRStatus _PR_MD_OPEN_DIR (_MDDir *md, const char *name)
char * _PR_MD_READ_DIR (_MDDir *md, PRIntn flags)
PRInt32 _PR_MD_CLOSE_DIR (_MDDir *md)
PRSem_PR_MD_OPEN_SEMAPHORE (const char *osname, PRIntn flags, PRIntn mode, PRUintn value)
PRStatus _PR_MD_WAIT_SEMAPHORE (PRSem *sem)
PRStatus _PR_MD_POST_SEMAPHORE (PRSem *sem)
PRStatus _PR_MD_CLOSE_SEMAPHORE (PRSem *sem)
PRStatus _PR_MD_DELETE_SEMAPHORE (const char *osname)
void _PR_MD_INIT_FILEDESC (PRFileDesc *fd)
void _PR_MD_MAKE_NONBLOCK (PRFileDesc *fd)
PRInt32 _PR_MD_OPEN (const char *name, PRIntn osflags, PRIntn mode)
PRInt32 _PR_MD_OPEN_FILE (const char *name, PRIntn osflags, PRIntn mode)
PRInt32 _PR_MD_CLOSE_FILE (PRInt32 osfd)
PRInt32 _PR_MD_READ (PRFileDesc *fd, void *buf, PRInt32 amount)
PRInt32 _PR_MD_WRITE (PRFileDesc *fd, const void *buf, PRInt32 amount)
PRInt32 _PR_MD_WRITEV (PRFileDesc *fd, const struct PRIOVec *iov, PRInt32 iov_size, PRIntervalTime timeout)
PRInt32 _PR_MD_FSYNC (PRFileDesc *fd)
PRInt32 _PR_MD_DELETE (const char *name)
PRInt32 _PR_MD_RENAME (const char *from, const char *to)
PRInt32 _PR_MD_ACCESS (const char *name, PRAccessHow how)
PRInt32 _PR_MD_STAT (const char *name, struct stat *buf)
PRInt32 _PR_MD_MKDIR (const char *name, PRIntn mode)
PRInt32 _PR_MD_MAKE_DIR (const char *name, PRIntn mode)
PRInt32 _PR_MD_RMDIR (const char *name)
void _PR_MD_INIT_IO (void)
PRInt32 _PR_MD_CLOSE_SOCKET (PRInt32 osfd)
PRInt32 _PR_MD_CONNECT (PRFileDesc *fd, const PRNetAddr *addr, PRUint32 addrlen, PRIntervalTime timeout)
PRInt32 _PR_MD_ACCEPT (PRFileDesc *fd, PRNetAddr *addr, PRUint32 *addrlen, PRIntervalTime timeout)
PRInt32 _PR_MD_BIND (PRFileDesc *fd, const PRNetAddr *addr, PRUint32 addrlen)
PRInt32 _PR_MD_LISTEN (PRFileDesc *fd, PRIntn backlog)
PRInt32 _PR_MD_SHUTDOWN (PRFileDesc *fd, PRIntn how)
PRInt32 _PR_MD_RECV (PRFileDesc *fd, void *buf, PRInt32 amount, PRIntn flags, PRIntervalTime timeout)
PRInt32 _PR_MD_SEND (PRFileDesc *fd, const void *buf, PRInt32 amount, PRIntn flags, PRIntervalTime timeout)
PRInt32 _PR_MD_ACCEPT_READ (PRFileDesc *sd, PRInt32 *newSock, PRNetAddr **raddr, void *buf, PRInt32 amount, PRIntervalTime timeout)
PRInt32 _PR_MD_SENDFILE (PRFileDesc *sock, PRSendFileData *sfd, PRInt32 flags, PRIntervalTime timeout)
PRStatus _PR_MD_GETSOCKNAME (PRFileDesc *fd, PRNetAddr *addr, PRUint32 *addrlen)
PRStatus _PR_MD_GETPEERNAME (PRFileDesc *fd, PRNetAddr *addr, PRUint32 *addrlen)
PRStatus _PR_MD_GETSOCKOPT (PRFileDesc *fd, PRInt32 level, PRInt32 optname, char *optval, PRInt32 *optlen)
PRStatus _PR_MD_SETSOCKOPT (PRFileDesc *fd, PRInt32 level, PRInt32 optname, const char *optval, PRInt32 optlen)
PRStatus PR_CALLBACK _PR_SocketGetSocketOption (PRFileDesc *fd, PRSocketOptionData *data)
PRStatus PR_CALLBACK _PR_SocketSetSocketOption (PRFileDesc *fd, const PRSocketOptionData *data)
PRInt32 _PR_MD_RECVFROM (PRFileDesc *fd, void *buf, PRInt32 amount, PRIntn flags, PRNetAddr *addr, PRUint32 *addrlen, PRIntervalTime timeout)
PRInt32 _PR_MD_SENDTO (PRFileDesc *fd, const void *buf, PRInt32 amount, PRIntn flags, const PRNetAddr *addr, PRUint32 addrlen, PRIntervalTime timeout)
PRInt32 _PR_MD_SOCKETPAIR (int af, int type, int flags, PRInt32 *osfd)
PRInt32 _PR_MD_SOCKET (int af, int type, int flags)
PRInt32 _PR_MD_SOCKETAVAILABLE (PRFileDesc *fd)
PRInt32 _PR_MD_PIPEAVAILABLE (PRFileDesc *fd)
PRInt32 _PR_MD_PR_POLL (PRPollDesc *pds, PRIntn npds, PRIntervalTime timeout)
void _PR_MD_INIT_FD_INHERITABLE (PRFileDesc *fd, PRBool imported)
PRStatus _PR_MD_SET_FD_INHERITABLE (PRFileDesc *fd, PRBool inheritable)
void_PR_MD_GET_SP (PRThread *thread)
PROffset32 _PR_MD_LSEEK (PRFileDesc *fd, PROffset32 offset, PRSeekWhence whence)
PROffset64 _PR_MD_LSEEK64 (PRFileDesc *fd, PROffset64 offset, PRSeekWhence whence)
PRInt32 _PR_MD_GETFILEINFO (const char *fn, PRFileInfo *info)
PRInt32 _PR_MD_GETFILEINFO64 (const char *fn, PRFileInfo64 *info)
PRInt32 _PR_MD_GETOPENFILEINFO (const PRFileDesc *fd, PRFileInfo *info)
PRInt32 _PR_MD_GETOPENFILEINFO64 (const PRFileDesc *fd, PRFileInfo64 *info)
void _PR_InitFdCache (void)
void _PR_CleanupFdCache (void)
PRFileDesc_PR_Getfd (void)
void _PR_Putfd (PRFileDesc *fd)
PRIntn _PR_InvalidInt (void)
PRInt16 _PR_InvalidInt16 (void)
PRInt64 _PR_InvalidInt64 (void)
PRStatus _PR_InvalidStatus (void)
PRFileDesc_PR_InvalidDesc (void)
PRUintn _PR_NetAddrSize (const PRNetAddr *addr)
PRStatus _PR_MapOptionName (PRSockOption optname, PRInt32 *level, PRInt32 *name)
void _PR_InitThreads (PRThreadType type, PRThreadPriority priority, PRUintn maxPTDs)
void _PR_InitLocks (void)
void _PR_DestroyThreadPrivate (PRThread *)
void _PR_InitSegs (void)
void _PR_InitStacks (void)
void _PR_InitTPD (void)
void _PR_InitMem (void)
void _PR_InitEnv (void)
void _PR_InitCMon (void)
void _PR_InitIO (void)
void _PR_InitLog (void)
void _PR_InitNet (void)
void _PR_InitClock (void)
void _PR_InitLinker (void)
void _PR_InitAtomic (void)
void _PR_InitCPUs (void)
void _PR_InitDtoa (void)
void _PR_InitTime (void)
void _PR_InitMW (void)
void _PR_InitRWLocks (void)
void _PR_NotifyCondVar (PRCondVar *cvar, PRThread *me)
void _PR_CleanupThread (PRThread *thread)
void _PR_CleanupCallOnce (void)
void _PR_CleanupMW (void)
void _PR_CleanupTime (void)
void _PR_CleanupDtoa (void)
void _PR_ShutdownLinker (void)
void _PR_CleanupEnv (void)
void _PR_CleanupIO (void)
void _PR_CleanupNet (void)
void _PR_CleanupLayerCache (void)
void _PR_CleanupStacks (void)
void _PR_CleanupThreads (void)
void _PR_CleanupTPD (void)
void _PR_Cleanup (void)
void _PR_LogCleanup (void)
void _PR_InitLayerCache (void)
void _PR_ImplicitInitialization (void)
PRBool _PR_Obsolete (const char *obsolete, const char *preferred)
void _PR_MD_EARLY_INIT (void)
void _PR_MD_INTERVAL_INIT (void)
PRProcess_PR_MD_CREATE_PROCESS (const char *path, char *const *argv, char *const *envp, const PRProcessAttr *attr)
PRStatus _PR_MD_DETACH_PROCESS (PRProcess *process)
PRStatus _PR_MD_WAIT_PROCESS (PRProcess *process, PRInt32 *exitCode)
PRStatus _PR_MD_KILL_PROCESS (PRProcess *process)
 NSPR_API (PRTime) _PR_MD_NOW(void)
char * _PR_MD_GET_ENV (const char *name)
PRIntn _PR_MD_PUT_ENV (const char *name)
void _PR_MD_INIT_ATOMIC (void)
PRInt32 _PR_MD_ATOMIC_INCREMENT (PRInt32 *)
PRInt32 _PR_MD_ATOMIC_ADD (PRInt32 *, PRInt32)
PRInt32 _PR_MD_ATOMIC_DECREMENT (PRInt32 *)
PRInt32 _PR_MD_ATOMIC_SET (PRInt32 *, PRInt32)
PRWord_MD_HomeGCRegisters (PRThread *t, int isCurrent, int *np)
PRIntervalTime _PR_MD_GET_INTERVAL (void)
PRIntervalTime _PR_MD_INTERVAL_PER_SEC (void)
PRInt32 _PR_MD_SETTHREADAFFINITYMASK (PRThread *thread, PRUint32 mask)
PRInt32 _PR_MD_GETTHREADAFFINITYMASK (PRThread *thread, PRUint32 *mask)
PRStatus _PR_MD_LOCKFILE (PRInt32 osfd)
PRStatus _PR_MD_TLOCKFILE (PRInt32 osfd)
PRStatus _PR_MD_UNLOCKFILE (PRInt32 osfd)
PRStatus _PR_MD_CREATE_FILE_MAP (PRFileMap *fmap, PRInt64 size)
PRInt32 _PR_MD_GET_MEM_MAP_ALIGNMENT (void)
void_PR_MD_MEM_MAP (PRFileMap *fmap, PROffset64 offset, PRUint32 len)
PRStatus _PR_MD_MEM_UNMAP (void *addr, PRUint32 size)
PRStatus _PR_MD_CLOSE_FILE_MAP (PRFileMap *fmap)
PRSharedMemory_MD_OpenSharedMemory (const char *name, PRSize size, PRIntn flags, PRIntn mode)
void_MD_AttachSharedMemory (PRSharedMemory *shm, PRIntn flags)
PRStatus _MD_DetachSharedMemory (PRSharedMemory *shm, void *addr)
PRStatus _MD_CloseSharedMemory (PRSharedMemory *shm)
PRStatus _MD_DeleteSharedMemory (const char *name)
PRFileMap_md_OpenAnonFileMap (const char *dirName, PRSize size, PRFileMapProtect prot)
PRStatus _md_ExportFileMapAsString (PRFileMap *fm, PRSize bufSize, char *buf)
PRFileMap_md_ImportFileMapFromString (const char *fmstring)
PRStatus _PR_MakeNativeIPCName (const char *name, char *result, PRIntn size, _PRIPCType type)
PRStatus _PR_MD_GETHOSTNAME (char *name, PRUint32 namelen)
PRStatus _PR_MD_GETSYSINFO (PRSysInfo cmd, char *name, PRUint32 namelen)
void _PR_MD_QUERY_FD_INHERITABLE (PRFileDesc *fd)
PRSize _PR_MD_GetRandomNoise (void *buf, PRSize size)
PRSize _pr_CopyLowBits (void *dest, PRSize dstlen, void *src, PRSize srclen)

Variables

const char * msg
PRInt32 _native_threads_only
_PRInterruptTable _pr_interruptTable []
PRBool all
PRBool PRBool sticky
PRCList _pr_active_local_threadQ
PRCList _pr_active_global_threadQ
PRCList _pr_cpuQ
_MDLock _pr_cpuLock
PRInt32 _pr_md_idle_cpus
PRUint32 _pr_recycleThreads
PRLock_pr_deadQLock
PRUint32 _pr_numNativeDead
PRUint32 _pr_numUserDead
PRCList _pr_deadNativeQ
PRCList _pr_deadUserQ
PRUint32 _pr_utid
struct _PRCPU_pr_primordialCPU
PRLock_pr_activeLock
PRInt32 _pr_userActive
PRInt32 _pr_systemActive
PRInt32 _pr_primordialExitCount
PRCondVar_pr_primordialExitCVar
PRUintn _pr_maxPTDs
PRLock_pr_terminationCVLock
PRIntervalTime timeout
PRBool propogate_time
void(* start )(void *arg)
void(*) void arg )
void(*) void PRThreadPriorit priority )
void(*) void PRThreadPriority
PRThreadScop 
scope )
void(*) void PRThreadPriority
PRThreadScope PRThreadStat 
state )
void(*) void PRThreadPriority
PRThreadScope PRThreadState
PRUint3 
stackSize )
void(*) void PRThreadPriority
PRThreadScope PRThreadState
PRUint32 PRUint3 
flags )
PRIntn redzone
_MDLockmdLock
_MDLocklock
PRIOMethods _pr_faulty_methods
PRBool _pr_initialized
PRInt32 _pr_pageSize
PRInt32 _pr_pageShift
PRLogModuleInfo_pr_clock_lm
PRLogModuleInfo_pr_cmon_lm
PRLogModuleInfo_pr_io_lm
PRLogModuleInfo_pr_cvar_lm
PRLogModuleInfo_pr_mon_lm
PRLogModuleInfo_pr_linker_lm
PRLogModuleInfo_pr_sched_lm
PRLogModuleInfo_pr_thread_lm
PRLogModuleInfo_pr_gc_lm
PRFileDesc_pr_stdin
PRFileDesc_pr_stdout
PRFileDesc_pr_stderr

Class Documentation

struct _PRCPUQueue

Definition at line 261 of file primpl.h.

Class Members
_MDLock miscQLock
PRUintn numCPUs
PRCList pauseQ
PRCList runQ
_MDLock runQLock
PRUint32 runQReadyMask
PRCList sleepQ
_MDLock sleepQLock
PRIntervalTime sleepQmax
PRCList suspendQ
PRCList waitingToJoinQ
struct _PRCPU

Definition at line 277 of file primpl.h.

Collaboration diagram for _PRCPU:
Class Members
PRPackedBool exit
PRUint32 id
PRThread * idle_thread
PRIntervalTime last_clock
PRCList links
_MDCPU md
PRPackedBool paused
_PRCPUQueue * queue
PRThread * thread
union _PRCPU u
PRIntn where
struct PRLock

Definition at line 1438 of file primpl.h.

Collaboration diagram for PRLock:
Class Members
PRThreadPriority boostPriority
_MDLock ilock
PRCList links
struct PRThread * owner
PRThreadPriority priority
PRCList waitQ
struct PRCondVar

Definition at line 1460 of file primpl.h.

Collaboration diagram for PRCondVar:
Class Members
PRCList condQ
_MDLock ilock
PRLock * lock
_MDCVar md
struct PRMonitor

Definition at line 1481 of file primpl.h.

Collaboration diagram for PRMonitor:
Class Members
PRCondVar * cvar
PRUint32 entryCount
const char * name
struct PRSemaphore

Definition at line 1495 of file primpl.h.

Collaboration diagram for PRSemaphore:
Class Members
PRUintn count
PRCondVar * cvar
_MDSemaphore md
PRUint32 waiters
struct PRSem

Definition at line 1514 of file primpl.h.

Class Members
PRInt8 notused
struct PRStackStr

Definition at line 1528 of file primpl.h.

Collaboration diagram for PRStackStr:
Class Members
PRStackElem prstk_head
PRLock * prstk_lock
char * prstk_name
struct PRThreadStack

Definition at line 1543 of file primpl.h.

Collaboration diagram for PRThreadStack:
Class Members
char * allocBase
PRUint32 allocSize
PRUintn flags
PRCList links
_MDThreadStack md
PRSegment * seg
char * stackBottom
PRUint32 stackSize
char * stackTop
PRThread * thr
struct PRThread

Definition at line 1566 of file primpl.h.

Collaboration diagram for PRThread:
Class Members
PRCList active
void * arg
_PRCPU * cpu
PRThreadDumpProc dump
void * dumpArg
void * environment
PRErrorCode errorCode
char * errorString
PRIntn errorStringLength
PRInt32 errorStringSize
PRUint32 flags
PRUint32 id
PRInt32 io_fd
PRBool io_pending
PRBool io_suspended
PRCList links
PRCList lockList
_MDThread md
PRUint32 no_sched
PRInt32 osErrorCode
PRThreadPriority priority
void ** privateData
PRUint32 queueCount
PRIntervalTime sleep
PRThreadStack * stack
_PRStartFn startFunc
PRUint32 state
PRCondVar * term
PRUint32 threadAllocatedOnStack
_MDLock threadLock
PRUint32 tpdLength
struct _wait wait
PRUint32 waitCount
PRCList waitQLinks
struct PRThread::_wait

Definition at line 1631 of file primpl.h.

Collaboration diagram for PRThread::_wait:
Class Members
struct PRCondVar * cvar
struct PRLock * lock
struct PRProcessAttr

Definition at line 1680 of file primpl.h.

Collaboration diagram for PRProcessAttr:
Class Members
char * currentDirectory
char * fdInheritBuffer
PRSize fdInheritBufferSize
PRSize fdInheritBufferUsed
PRFileDesc * stderrFd
PRFileDesc * stdinFd
PRFileDesc * stdoutFd
struct PRProcess

Definition at line 1690 of file primpl.h.

Class Members
_MDProcess md
struct PRFileMap

Definition at line 1694 of file primpl.h.

Collaboration diagram for PRFileMap:
Class Members
PRFileDesc * fd
_MDFileMap md
PRFileMapProtect prot
struct PRFilePrivate

Definition at line 1728 of file primpl.h.

Collaboration diagram for PRFilePrivate:
Class Members
PRBool appendMode
_PRTriStateBool inheritable
PRIntn lockCount
_MDFileDesc md
PRFileDesc * next
PRBool nonblocking
PRInt32 rcvinprogress
PRInt32 rcvreq
RcvState rcvstate
PRInt32 state
PRFileDesc * writeEnd
PRInt32 xmtinprogress
PRInt32 xmtreq
XmtState xmtstate
struct PRDir

Definition at line 1755 of file primpl.h.

Class Members
PRDirEntry d
_MDDir md
struct PRSegment

Definition at line 1814 of file primpl.h.

Class Members
PRUintn flags
_MDSegment md
PRUint32 size
void * vaddr
struct PRSharedMemory

Definition at line 2001 of file primpl.h.

Class Members
PRIntn flags
PRUint32 ident
char * ipcname
PRIntn mode
PRUint32 nothing
PRSize size
union _PRCPU.u

Definition at line 281 of file primpl.h.

Class Members
PRInt32 bits
PRUint8 missed

Define Documentation

Definition at line 312 of file primpl.h.

Definition at line 632 of file primpl.h.

Definition at line 685 of file primpl.h.

Definition at line 684 of file primpl.h.

#define _PR_ACTIVE_THREAD_PTR (   _qp)    ((PRThread*) ((char*) (_qp) - offsetof(PRThread,active)))

Definition at line 666 of file primpl.h.

#define _PR_ADD_JOINQ (   _thread,
  _cpu 
)
Value:
PR_ASSERT((_thread)->queueCount == 0); \
    (_thread)->queueCount = QUEUE_JOIN; \
    PR_APPEND_LINK(&(_thread)->links, &_PR_WAITINGTOJOINQ(_cpu));

Definition at line 524 of file primpl.h.

#define _PR_ADD_RUNQ (   _thread,
  _cpu,
  _pri 
)
Value:
PR_BEGIN_MACRO \
    PR_APPEND_LINK(&(_thread)->links, &_PR_RUNQ(_cpu)[_pri]); \
    _PR_RUNQREADYMASK(_cpu) |= (1L << _pri); \
    PR_ASSERT((_thread)->queueCount == 0); \
    (_thread)->queueCount = QUEUE_RUN; \
    PR_END_MACRO

Definition at line 495 of file primpl.h.

#define _PR_ADD_SLEEPQ (   _thread,
  _timeout 
)
Value:
PR_ASSERT((_thread)->queueCount == 0); \
    (_thread)->queueCount = QUEUE_SLEEP; \
    _PR_AddSleepQ(_thread, _timeout);

Definition at line 514 of file primpl.h.

#define _PR_ADD_SUSPENDQ (   _thread,
  _cpu 
)
Value:
PR_ASSERT((_thread)->queueCount == 0); \
    (_thread)->queueCount = QUEUE_SUSPEND; \
    PR_APPEND_LINK(&(_thread)->links, &_PR_SUSPENDQ(_cpu));

Definition at line 534 of file primpl.h.

Value:
PR_BEGIN_MACRO \
    if (stackSize == 0) \
                stackSize = _MD_DEFAULT_STACK_SIZE; \
    if (stackSize < _MD_MINIMUM_STACK_SIZE) \
                stackSize = _MD_MINIMUM_STACK_SIZE; \
    stackSize = (stackSize + (1 << _pr_pageShift) - 1) >> _pr_pageShift; \
    stackSize <<= _pr_pageShift; \
        PR_END_MACRO

Definition at line 636 of file primpl.h.

#define _PR_ATTACHED   0x04 /* created via PR_AttachThread */

Definition at line 597 of file primpl.h.

#define _PR_BOUND_THREAD   0x800 /* a bound thread */

Definition at line 605 of file primpl.h.

#define _PR_CLEAR_RESCHED_FLAG ( )    _PR_MD_CURRENT_CPU()->u.missed[3] = 0

Definition at line 555 of file primpl.h.

Definition at line 613 of file primpl.h.

Definition at line 486 of file primpl.h.

Definition at line 487 of file primpl.h.

#define _PR_CPU_PTR (   _qp)    ((_PRCPU*) ((char*) (_qp) - offsetof(_PRCPU,links)))

Definition at line 307 of file primpl.h.

#define _PR_CPUQ ( )    _pr_cpuQ

Definition at line 686 of file primpl.h.

#define _PR_CVAR_LOCK (   _cvar)    _PR_MD_LOCK(&(_cvar)->ilock);

Definition at line 583 of file primpl.h.

#define _PR_CVAR_UNLOCK (   _cvar)    _PR_MD_UNLOCK(&(_cvar)->ilock);

Definition at line 585 of file primpl.h.

#define _PR_DEAD_STATE   8 /* for debugging */

Definition at line 617 of file primpl.h.

Definition at line 701 of file primpl.h.

Definition at line 703 of file primpl.h.

Definition at line 704 of file primpl.h.

Definition at line 702 of file primpl.h.

Definition at line 706 of file primpl.h.

Definition at line 709 of file primpl.h.

#define _PR_DEL_JOINQ (   _thread)
Value:
PR_ASSERT((_thread)->queueCount == QUEUE_JOIN);\
    (_thread)->queueCount = 0; \
    PR_REMOVE_LINK(&(_thread)->links);

Definition at line 529 of file primpl.h.

#define _PR_DEL_RUNQ (   _thread)
Value:
PR_BEGIN_MACRO \
    _PRCPU *_cpu = _thread->cpu; \
    PRInt32 _pri = _thread->priority; \
    PR_REMOVE_LINK(&(_thread)->links); \
    if (PR_CLIST_IS_EMPTY(&_PR_RUNQ(_cpu)[_pri])) \
        _PR_RUNQREADYMASK(_cpu) &= ~(1L << _pri); \
    PR_ASSERT((_thread)->queueCount == QUEUE_RUN);\
    (_thread)->queueCount = 0; \
    PR_END_MACRO

Definition at line 503 of file primpl.h.

#define _PR_DEL_SLEEPQ (   _thread,
  _propogate 
)
Value:
PR_ASSERT((_thread)->queueCount == QUEUE_SLEEP);\
    (_thread)->queueCount = 0; \
    _PR_DelSleepQ(_thread, _propogate);

Definition at line 519 of file primpl.h.

#define _PR_DEL_SUSPENDQ (   _thread)
Value:
PR_ASSERT((_thread)->queueCount == QUEUE_SUSPEND);\
    (_thread)->queueCount = 0; \
    PR_REMOVE_LINK(&(_thread)->links);

Definition at line 539 of file primpl.h.

Value:

Definition at line 391 of file primpl.h.

#define _PR_FILEDESC_CLOSED   0x55555555 /* 0101010... */

Definition at line 1715 of file primpl.h.

#define _PR_FILEDESC_FREED   0x11111111

Definition at line 1716 of file primpl.h.

#define _PR_FILEDESC_OPEN   0xaaaaaaaa /* 1010101... */

Definition at line 1714 of file primpl.h.

#define _PR_GCABLE_THREAD   0x400 /* this is a collectable thread */

Definition at line 604 of file primpl.h.

#define _PR_GLOBAL_SCOPE   0x80 /* thread is global scope */

Definition at line 602 of file primpl.h.

#define _PR_IDLE_THREAD   0x200 /* this is an idle thread */

Definition at line 603 of file primpl.h.

Definition at line 705 of file primpl.h.

Definition at line 708 of file primpl.h.

#define _PR_INTERRUPT   0x02

Definition at line 596 of file primpl.h.

#define _PR_INTERRUPT_BLOCKED   0x1000 /* interrupts blocked */

Definition at line 606 of file primpl.h.

Value:
PR_BEGIN_MACRO \
        (_is) = _PR_MD_GET_INTSOFF(); \
        _PR_MD_SET_INTSOFF(1); \
    PR_END_MACRO

Definition at line 383 of file primpl.h.

Value:
PR_BEGIN_MACRO \
        if ((_is == 0) && (_PR_MD_CURRENT_CPU())->u.bits) \
                _PR_IntsOn((_PR_MD_CURRENT_CPU())); \
        _PR_MD_SET_INTSOFF(_is); \
    PR_END_MACRO

Definition at line 396 of file primpl.h.

#define _PR_IO_PENDING (   _thread)    ((_thread)->io_pending)

Definition at line 797 of file primpl.h.

Definition at line 615 of file primpl.h.

#define _PR_IS_GCABLE_THREAD (   thr)    ((thr)->flags & _PR_GCABLE_THREAD)

Definition at line 653 of file primpl.h.

#define _PR_IS_NATIVE_THREAD (   thread)    (thread->flags & _PR_GLOBAL_SCOPE)

Definition at line 547 of file primpl.h.

Definition at line 548 of file primpl.h.

Definition at line 614 of file primpl.h.

#define _PR_LOCK_LOCK (   _lock)    _PR_MD_LOCK(&(_lock)->ilock);

Definition at line 571 of file primpl.h.

#define _PR_LOCK_PTR (   _qp)    ((PRLock*) ((char*) (_qp) - offsetof(PRLock,links)))

Definition at line 578 of file primpl.h.

#define _PR_LOCK_UNLOCK (   _lock)    _PR_MD_UNLOCK(&(_lock)->ilock);

Definition at line 573 of file primpl.h.

Definition at line 612 of file primpl.h.

Definition at line 1178 of file primpl.h.

Definition at line 1201 of file primpl.h.

Definition at line 1131 of file primpl.h.

Definition at line 1056 of file primpl.h.

Definition at line 1926 of file primpl.h.

Definition at line 1929 of file primpl.h.

Definition at line 1923 of file primpl.h.

Definition at line 1932 of file primpl.h.

Definition at line 2029 of file primpl.h.

Definition at line 989 of file primpl.h.

Definition at line 983 of file primpl.h.

Definition at line 1181 of file primpl.h.

Definition at line 820 of file primpl.h.

Definition at line 1001 of file primpl.h.

Definition at line 869 of file primpl.h.

Definition at line 844 of file primpl.h.

Definition at line 836 of file primpl.h.

Definition at line 1069 of file primpl.h.

Definition at line 1108 of file primpl.h.

Definition at line 1994 of file primpl.h.

Definition at line 1083 of file primpl.h.

Definition at line 2035 of file primpl.h.

Definition at line 1168 of file primpl.h.

Definition at line 1173 of file primpl.h.

Definition at line 1979 of file primpl.h.

Definition at line 1895 of file primpl.h.

Definition at line 1021 of file primpl.h.

Definition at line 854 of file primpl.h.

Definition at line 945 of file primpl.h.

Definition at line 1125 of file primpl.h.

Definition at line 1086 of file primpl.h.

Definition at line 2038 of file primpl.h.

Definition at line 1898 of file primpl.h.

Definition at line 2032 of file primpl.h.

Definition at line 817 of file primpl.h.

Definition at line 1880 of file primpl.h.

Definition at line 814 of file primpl.h.

Definition at line 992 of file primpl.h.

Definition at line 986 of file primpl.h.

Definition at line 1027 of file primpl.h.

Definition at line 872 of file primpl.h.

Definition at line 963 of file primpl.h.

Definition at line 2052 of file primpl.h.

Definition at line 1886 of file primpl.h.

Definition at line 930 of file primpl.h.

Definition at line 883 of file primpl.h.

Definition at line 1059 of file primpl.h.

Definition at line 1122 of file primpl.h.

Definition at line 948 of file primpl.h.

Definition at line 1912 of file primpl.h.

Definition at line 1952 of file primpl.h.

Definition at line 848 of file primpl.h.

Definition at line 1982 of file primpl.h.

Definition at line 2112 of file primpl.h.

Definition at line 2090 of file primpl.h.

Definition at line 1302 of file primpl.h.

Definition at line 1320 of file primpl.h.

Definition at line 1323 of file primpl.h.

Definition at line 2094 of file primpl.h.

Definition at line 1326 of file primpl.h.

Definition at line 1329 of file primpl.h.

Definition at line 1231 of file primpl.h.

Definition at line 1227 of file primpl.h.

Definition at line 1235 of file primpl.h.

Definition at line 2097 of file primpl.h.

Definition at line 1963 of file primpl.h.

Definition at line 2057 of file primpl.h.

Definition at line 1920 of file primpl.h.

Definition at line 968 of file primpl.h.

Definition at line 1043 of file primpl.h.

Definition at line 800 of file primpl.h.

Definition at line 1287 of file primpl.h.

Definition at line 1090 of file primpl.h.

Definition at line 1165 of file primpl.h.

Definition at line 877 of file primpl.h.

Definition at line 860 of file primpl.h.

Definition at line 1053 of file primpl.h.

Definition at line 841 of file primpl.h.

Definition at line 960 of file primpl.h.

Definition at line 1883 of file primpl.h.

Definition at line 1955 of file primpl.h.

Definition at line 896 of file primpl.h.

Definition at line 899 of file primpl.h.

Definition at line 1024 of file primpl.h.

Definition at line 1904 of file primpl.h.

Definition at line 951 of file primpl.h.

Definition at line 1184 of file primpl.h.

Definition at line 886 of file primpl.h.

Definition at line 1968 of file primpl.h.

Definition at line 1314 of file primpl.h.

Definition at line 1317 of file primpl.h.

Definition at line 1140 of file primpl.h.

Definition at line 1098 of file primpl.h.

Definition at line 1988 of file primpl.h.

Definition at line 1991 of file primpl.h.

Definition at line 1137 of file primpl.h.

Definition at line 927 of file primpl.h.

Definition at line 880 of file primpl.h.

Definition at line 937 of file primpl.h.

Definition at line 940 of file primpl.h.

Definition at line 1908 of file primpl.h.

Definition at line 1102 of file primpl.h.

Definition at line 2045 of file primpl.h.

Definition at line 1063 of file primpl.h.

Definition at line 1105 of file primpl.h.

Definition at line 1074 of file primpl.h.

Definition at line 2026 of file primpl.h.

Definition at line 866 of file primpl.h.

Definition at line 1268 of file primpl.h.

Definition at line 1080 of file primpl.h.

Definition at line 1272 of file primpl.h.

Definition at line 1915 of file primpl.h.

Definition at line 2107 of file primpl.h.

Definition at line 1111 of file primpl.h.

Definition at line 1066 of file primpl.h.

Definition at line 1191 of file primpl.h.

Definition at line 1251 of file primpl.h.

Definition at line 1128 of file primpl.h.

Definition at line 1049 of file primpl.h.

Definition at line 980 of file primpl.h.

Definition at line 974 of file primpl.h.

Definition at line 1039 of file primpl.h.

Definition at line 1143 of file primpl.h.

Definition at line 1196 of file primpl.h.

Definition at line 1223 of file primpl.h.

Definition at line 1256 of file primpl.h.

Definition at line 857 of file primpl.h.

Definition at line 954 of file primpl.h.

Definition at line 1290 of file primpl.h.

Definition at line 851 of file primpl.h.

Definition at line 957 of file primpl.h.

Definition at line 1033 of file primpl.h.

Definition at line 1240 of file primpl.h.

Definition at line 1960 of file primpl.h.

Definition at line 1187 of file primpl.h.

Definition at line 1262 of file primpl.h.

Definition at line 1265 of file primpl.h.

Definition at line 1259 of file primpl.h.

Definition at line 808 of file primpl.h.

Definition at line 1134 of file primpl.h.

Definition at line 811 of file primpl.h.

Definition at line 977 of file primpl.h.

Definition at line 971 of file primpl.h.

Definition at line 1036 of file primpl.h.

Definition at line 1046 of file primpl.h.

Definition at line 890 of file primpl.h.

Definition at line 1971 of file primpl.h.

Definition at line 823 of file primpl.h.

Definition at line 893 of file primpl.h.

Definition at line 1974 of file primpl.h.

Definition at line 829 of file primpl.h.

Definition at line 934 of file primpl.h.

Definition at line 1901 of file primpl.h.

Definition at line 1077 of file primpl.h.

Definition at line 803 of file primpl.h.

Definition at line 832 of file primpl.h.

Definition at line 1114 of file primpl.h.

Definition at line 1119 of file primpl.h.

Definition at line 1030 of file primpl.h.

#define _PR_MISCQ_LOCK (   _cpu)    _PR_MD_LOCK(&(_cpu)->queue->miscQLock );

Definition at line 480 of file primpl.h.

#define _PR_MISCQ_UNLOCK (   _cpu)    _PR_MD_UNLOCK(&(_cpu)->queue->miscQLock );

Definition at line 483 of file primpl.h.

Definition at line 562 of file primpl.h.

Definition at line 560 of file primpl.h.

#define _PR_MISSED_IO   0x2

Definition at line 561 of file primpl.h.

Definition at line 707 of file primpl.h.

Definition at line 710 of file primpl.h.

#define _PR_ON_PAUSEQ   0x20 /* thread is on the pauseQ */

Definition at line 600 of file primpl.h.

#define _PR_ON_SLEEPQ   0x10 /* thread is on the sleepQ */

Definition at line 599 of file primpl.h.

#define _PR_PAUSEQ (   _cpu)    ((_cpu)->queue->pauseQ)

Definition at line 691 of file primpl.h.

#define _PR_PENDING_INTERRUPT (   thr)    (!((thr)->flags & _PR_INTERRUPT_BLOCKED) && ((thr)->flags & _PR_INTERRUPT))

Definition at line 656 of file primpl.h.

Definition at line 1352 of file primpl.h.

Definition at line 1353 of file primpl.h.

Definition at line 1354 of file primpl.h.

Definition at line 1355 of file primpl.h.

#define _PR_PRIMORDIAL   0x08 /* the thread that called PR_Init */

Definition at line 598 of file primpl.h.

Value:
if (_PR_PENDING_INTERRUPT(me)) { \
                me->flags &= ~_PR_INTERRUPT; \
                PR_SetError( PR_PENDING_INTERRUPT_ERROR, 0); \
        } else { \
                PR_SetError(PR_IO_TIMEOUT_ERROR, 0); \
        }

Definition at line 1293 of file primpl.h.

Definition at line 610 of file primpl.h.

Definition at line 611 of file primpl.h.

#define _PR_RUNQ (   _cpu)    ((_cpu)->queue->runQ)

Definition at line 687 of file primpl.h.

#define _PR_RUNQ_LOCK (   _cpu)
Value:
PR_BEGIN_MACRO \
    _PR_MD_LOCK(&(_cpu)->queue->runQLock );\
    PR_END_MACRO

Definition at line 464 of file primpl.h.

#define _PR_RUNQ_UNLOCK (   _cpu)
Value:
PR_BEGIN_MACRO \
    _PR_MD_UNLOCK(&(_cpu)->queue->runQLock );\
    PR_END_MACRO

Definition at line 469 of file primpl.h.

#define _PR_RUNQREADYMASK (   _cpu)    ((_cpu)->queue->runQReadyMask)

Definition at line 688 of file primpl.h.

#define _PR_SEG_VM   0x1

Definition at line 1825 of file primpl.h.

#define _PR_SET_RESCHED_FLAG ( )    _PR_MD_CURRENT_CPU()->u.missed[3] = 1

Definition at line 554 of file primpl.h.

#define _PR_SHM_IDENT   0xdeadbad

Definition at line 2017 of file primpl.h.

#define _PR_SLEEPQ (   _cpu)    ((_cpu)->queue->sleepQ)

Definition at line 689 of file primpl.h.

#define _PR_SLEEPQ_LOCK (   _cpu)    _PR_MD_LOCK(&(_cpu)->queue->sleepQLock );

Definition at line 474 of file primpl.h.

#define _PR_SLEEPQ_UNLOCK (   _cpu)    _PR_MD_UNLOCK(&(_cpu)->queue->sleepQLock );

Definition at line 477 of file primpl.h.

#define _PR_SLEEPQMAX (   _cpu)    ((_cpu)->queue->sleepQmax)

Definition at line 690 of file primpl.h.

#define _PR_STACK_MAPPED   0x2 /* vm is mapped */

Definition at line 621 of file primpl.h.

#define _PR_STACK_PRIMORDIAL   0x4 /* stack for primordial thread */

Definition at line 622 of file primpl.h.

#define _PR_STACK_VM   0x1 /* using vm instead of malloc */

Definition at line 620 of file primpl.h.

Definition at line 616 of file primpl.h.

#define _PR_SUSPENDING   0x40 /* thread wants to suspend */

Definition at line 601 of file primpl.h.

#define _PR_SUSPENDQ (   _cpu)    ((_cpu)->queue->suspendQ)

Definition at line 692 of file primpl.h.

#define _PR_SYSTEM   0x01

Definition at line 595 of file primpl.h.

Definition at line 658 of file primpl.h.

#define _PR_THREAD_CONDQ_PTR (   _qp)    ((PRThread*) ((char*) (_qp) - offsetof(PRThread,waitQLinks)))

Definition at line 669 of file primpl.h.

#define _PR_THREAD_LOCK (   _thread)    _PR_MD_LOCK(&(_thread)->threadLock);

Definition at line 458 of file primpl.h.

#define _PR_THREAD_MD_TO_PTR (   _md)    ((PRThread*) ((char*) (_md) - offsetof(PRThread,md)))

Definition at line 672 of file primpl.h.

#define _PR_THREAD_PTR (   _qp)    ((PRThread*) ((char*) (_qp) - offsetof(PRThread,links)))

Definition at line 663 of file primpl.h.

#define _PR_THREAD_STACK_TO_PTR (   _stack)    ((PRThread*) (_stack->thr))

Definition at line 675 of file primpl.h.

#define _PR_THREAD_SWITCH_CPU (   _thread,
  _newCPU 
)    (_thread)->cpu = (_newCPU);

Definition at line 544 of file primpl.h.

Definition at line 660 of file primpl.h.

#define _PR_THREAD_UNLOCK (   _thread)    _PR_MD_UNLOCK(&(_thread)->threadLock);

Definition at line 461 of file primpl.h.

#define _PR_UNBORN   0

Definition at line 609 of file primpl.h.

#define _PR_WAITINGTOJOINQ (   _cpu)    ((_cpu)->queue->waitingToJoinQ)

Definition at line 693 of file primpl.h.

Definition at line 2067 of file primpl.h.

#define PR_NETADDR_SIZE (   _addr)
Value:
((_addr)->raw.family == PR_AF_INET        \
        ? sizeof((_addr)->inet)                                \
        : sizeof((_addr)->ipv6))

Definition at line 1425 of file primpl.h.

#define QUEUE_JOIN   0x4

Definition at line 491 of file primpl.h.

#define QUEUE_LOCK   0x10

Definition at line 493 of file primpl.h.

#define QUEUE_RUN   0x1

Definition at line 489 of file primpl.h.

#define QUEUE_SLEEP   0x2

Definition at line 490 of file primpl.h.

#define QUEUE_SUSPEND   0x8

Definition at line 492 of file primpl.h.


Typedef Documentation

typedef struct _MDCPU

Definition at line 259 of file primpl.h.

typedef struct _MDCVar

Definition at line 144 of file primpl.h.

typedef struct _MDDir

Definition at line 149 of file primpl.h.

typedef struct _MDFileDesc

Definition at line 153 of file primpl.h.

typedef struct _MDFileMap

Definition at line 155 of file primpl.h.

typedef typedefPR_BEGIN_EXTERN_C struct _MDLock

Definition at line 143 of file primpl.h.

typedef struct _MDProcess

Definition at line 154 of file primpl.h.

typedef struct _MDSegment

Definition at line 145 of file primpl.h.

typedef struct _MDSemaphore

Definition at line 148 of file primpl.h.

typedef struct _MDThread

Definition at line 146 of file primpl.h.

typedef struct _MDThreadStack

Definition at line 147 of file primpl.h.

typedef struct _PRCPU

Definition at line 258 of file primpl.h.

typedef struct _PRCPUQueue

Definition at line 257 of file primpl.h.

Definition at line 1564 of file primpl.h.

typedef struct PRSegment

Definition at line 72 of file primpl.h.


Enumeration Type Documentation

enum _PRIPCType
Enumerator:
_PRIPCSem 
_PRIPCShm 

Definition at line 2072 of file primpl.h.

             {
    _PRIPCSem,  /* semaphores */
    _PRIPCShm   /* shared memory segments */
} _PRIPCType;
Enumerator:
_PR_TRI_TRUE 
_PR_TRI_FALSE 
_PR_TRI_UNKNOWN 
_PR_TRI_TRUE 
_PR_TRI_FALSE 
_PR_TRI_UNKNOWN 

Definition at line 1722 of file primpl.h.


Function Documentation

void* _MD_AttachSharedMemory ( PRSharedMemory shm,
PRIntn  flags 
)

Definition at line 65 of file prshm.c.

{
    PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
    return NULL;
}    

Definition at line 77 of file prshm.c.

{
    PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
    return PR_FAILURE;
}    

Definition at line 83 of file prshm.c.

{
    PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
    return PR_FAILURE;
}    

Definition at line 71 of file prshm.c.

{
    PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
    return PR_FAILURE;
}    
PRStatus _md_ExportFileMapAsString ( PRFileMap fm,
PRSize  bufSize,
char *  buf 
)

Definition at line 606 of file uxshm.c.

{
    PRIntn  written;
    PRIntn  prot = (PRIntn)fm->prot;
    
    written = PR_snprintf( buf, bufSize, "%ld:%d",
        fm->fd->secret->md.osfd, prot );
        
    return((written == -1)? PR_FAILURE : PR_SUCCESS);
} /* end _md_ExportFileMapAsString() */

Here is the call graph for this function:

PRWord* _MD_HomeGCRegisters ( PRThread t,
int  isCurrent,
int np 
)

Definition at line 89 of file btmisc.c.

{
     return 0;
}

Here is the caller graph for this function:

Definition at line 622 of file uxshm.c.

{
    PRStatus    rc;
    PRInt32     osfd;
    PRIntn      prot; /* really: a PRFileMapProtect */
    PRFileDesc  *fd;
    PRFileMap   *fm = NULL; /* default return value */
    PRFileInfo64 info;

    PR_sscanf( fmstring, "%ld:%d", &osfd, &prot );

    /* import the os file descriptor */
    fd = PR_ImportFile( osfd );
    if ( NULL == fd ) {
        PR_LOG( _pr_shma_lm, PR_LOG_DEBUG,
            ("_md_ImportFileMapFromString(): PR_ImportFile() failed"));
        goto Finished;
    }

    rc = PR_GetOpenFileInfo64( fd, &info );
    if ( PR_FAILURE == rc )  {
        PR_LOG( _pr_shma_lm, PR_LOG_DEBUG,
            ("_md_ImportFileMapFromString(): PR_GetOpenFileInfo64() failed"));    
        goto Finished;
    }

    fm = PR_CreateFileMap( fd, info.size, (PRFileMapProtect)prot );
    if ( NULL == fm ) {
        PR_LOG( _pr_shma_lm, PR_LOG_DEBUG,
            ("_md_ImportFileMapFromString(): PR_CreateFileMap() failed"));    
    }

Finished:
    return(fm);
} /* end _md_ImportFileMapFromString() */

Here is the call graph for this function:

PRFileMap* _md_OpenAnonFileMap ( const char *  dirName,
PRSize  size,
PRFileMapProtect  prot 
)

Definition at line 493 of file uxshm.c.

{
    PRFileMap   *fm = NULL;
    PRFileDesc  *fd;
    int         osfd;
    PRIntn      urc;
    PRIntn      mode = 0600;
    char        *genName;
    pid_t       pid = getpid(); /* for generating filename */
    PRThread    *tid = PR_GetCurrentThread(); /* for generating filename */
    int         incr; /* for generating filename */
    const int   maxTries = 20; /* maximum # attempts at a unique filename */
    PRInt64     size64; /* 64-bit version of 'size' */

    /*
    ** generate a filename from input and runtime environment
    ** open the file, unlink the file.
    ** make maxTries number of attempts at uniqueness in the filename
    */
    for ( incr = 0; incr < maxTries ; incr++ ) {
        genName = PR_smprintf( "%s/.NSPR-AFM-%d-%p.%d", 
            dirName, (int) pid, tid, incr );
        if ( NULL == genName ) {
            PR_LOG( _pr_shma_lm, PR_LOG_DEBUG,
                ("_md_OpenAnonFileMap(): PR_snprintf(): failed, generating filename"));
            goto Finished;
        }
        
        /* create the file */
        osfd = open( genName, (O_CREAT | O_EXCL | O_RDWR), mode );
        if ( -1 == osfd ) {
            if ( EEXIST == errno )  {
                PR_smprintf_free( genName );
                continue; /* name exists, try again */
            } else {
                _PR_MD_MAP_OPEN_ERROR( errno );
                PR_LOG( _pr_shma_lm, PR_LOG_DEBUG,
                    ("_md_OpenAnonFileMap(): open(): failed, filename: %s, errno: %d", 
                        genName, PR_GetOSError()));
                PR_smprintf_free( genName );
                goto Finished;
            }
        }
        break; /* name generation and open successful, break; */
    } /* end for() */

    if ( incr == maxTries ) {
        PR_ASSERT( -1 == osfd );
        PR_ASSERT( EEXIST == errno );
        _PR_MD_MAP_OPEN_ERROR( errno );
        goto Finished;
    }

    urc = unlink( genName );
    if ( -1 == urc ) {
        _PR_MD_MAP_UNLINK_ERROR( errno );
        PR_LOG( _pr_shma_lm, PR_LOG_DEBUG,
            ("_md_OpenAnonFileMap(): failed on unlink(), errno: %d", errno));
        PR_smprintf_free( genName );
        close( osfd );
        goto Finished;        
    }
    PR_LOG( _pr_shma_lm, PR_LOG_DEBUG,
        ("_md_OpenAnonFileMap(): unlink(): %s", genName ));

    PR_smprintf_free( genName );

    fd = PR_ImportFile( osfd );
    if ( NULL == fd ) {
        PR_LOG( _pr_shma_lm, PR_LOG_DEBUG,
            ("_md_OpenAnonFileMap(): PR_ImportFile(): failed"));
        goto Finished;        
    }
    PR_LOG( _pr_shma_lm, PR_LOG_DEBUG,
        ("_md_OpenAnonFileMap(): fd: %p", fd ));

    urc = ftruncate( fd->secret->md.osfd, size );
    if ( -1 == urc ) {
        _PR_MD_MAP_DEFAULT_ERROR( errno );
        PR_LOG( _pr_shma_lm, PR_LOG_DEBUG,
            ("_md_OpenAnonFileMap(): failed on ftruncate(), errno: %d", errno));
        PR_Close( fd );
        goto Finished;        
    }
    PR_LOG( _pr_shma_lm, PR_LOG_DEBUG,
        ("_md_OpenAnonFileMap(): ftruncate(): size: %d", size ));

    LL_UI2L(size64, size);  /* PRSize (size_t) is unsigned */
    fm = PR_CreateFileMap( fd, size64, prot );
    if ( NULL == fm )  {
        PR_LOG( _pr_shma_lm, PR_LOG_DEBUG,
            ("PR_OpenAnonFileMap(): failed"));
        PR_Close( fd );
        goto Finished;        
    }
    fm->md.isAnonFM = PR_TRUE; /* set fd close */

    PR_LOG( _pr_shma_lm, PR_LOG_DEBUG,
        ("_md_OpenAnonFileMap(): PR_CreateFileMap(): fm: %p", fm ));

Finished:    
    return(fm);
} /* end md_OpenAnonFileMap() */

Here is the call graph for this function:

PRSharedMemory* _MD_OpenSharedMemory ( const char *  name,
PRSize  size,
PRIntn  flags,
PRIntn  mode 
)

Definition at line 59 of file prshm.c.

{
    PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
    return NULL;
}    
void _PR_AddThreadToRunQ ( PRThread me,
PRThread thread 
)

Definition at line 1874 of file pruthr.c.

{
    PRThreadPriority pri = thread->priority;
    _PRCPU *cpu = thread->cpu;

    PR_ASSERT(!_PR_IS_NATIVE_THREAD(thread));

#if defined(WINNT)
    /*
     * On NT, we can only reliably know that the current CPU
     * is not idle.  We add the awakened thread to the run
     * queue of its CPU if its CPU is the current CPU.
     * For any other CPU, we don't really know whether it
     * is busy or idle.  So in all other cases, we just
     * "post" the awakened thread to the IO completion port
     * for the next idle CPU to execute (this is done in
     * _PR_MD_WAKEUP_WAITER).
        * Threads with a suspended I/O operation remain bound to
        * the same cpu until I/O is cancelled
     *
     * NOTE: the boolean expression below must be the exact
     * opposite of the corresponding boolean expression in
     * _PR_MD_WAKEUP_WAITER.
     */
    if ((!_PR_IS_NATIVE_THREAD(me) && (cpu == me->cpu)) ||
                                   (thread->md.thr_bound_cpu)) {
              PR_ASSERT(!thread->md.thr_bound_cpu ||
                                                 (thread->md.thr_bound_cpu == cpu));
        _PR_RUNQ_LOCK(cpu);
        _PR_ADD_RUNQ(thread, cpu, pri);
        _PR_RUNQ_UNLOCK(cpu);
    }
#else
    _PR_RUNQ_LOCK(cpu);
    _PR_ADD_RUNQ(thread, cpu, pri);
    _PR_RUNQ_UNLOCK(cpu);
    if (!_PR_IS_NATIVE_THREAD(me) && (cpu == me->cpu)) {
        if (pri > me->priority) {
            _PR_SET_RESCHED_FLAG();
        }
    }
#endif
}

Here is the caller graph for this function:

Definition at line 795 of file prinit.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 52 of file prdtoa.c.

{
    PR_DestroyLock(dtoa_lock[0]);
    dtoa_lock[0] = NULL;
    PR_DestroyLock(dtoa_lock[1]);
    dtoa_lock[1] = NULL;

    /* FIXME: deal with freelist and p5s. */
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 70 of file prenv.c.

Here is the caller graph for this function:

Definition at line 298 of file prfdcach.c.

{
    PRFileDesc *fd, *next;
    PRStackElem *pop;

    for (fd = _pr_fd_cache.head; fd != NULL; fd = next)
    {
        next = fd->higher;
        PR_DELETE(fd->secret);
        PR_DELETE(fd);
    }
    PR_DestroyLock(_pr_fd_cache.ml);
    while ((pop = PR_StackPop(_pr_fd_cache.stack)) != NULL)
    {
        fd = (PRFileDesc*)((PRPtrdiff)pop - (PRPtrdiff)stack2fd);
        PR_DELETE(fd->secret);
        PR_DELETE(fd);
    }
    PR_DestroyStack(_pr_fd_cache.stack);
}  /* _PR_CleanupFdCache */

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 81 of file prio.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 749 of file prlayer.c.

{
    if (identity_cache.ml)
    {
        PR_DestroyLock(identity_cache.ml);
        identity_cache.ml = NULL;
    }

    if (identity_cache.name)
    {
        PRDescIdentity ident;

        for (ident = 0; ident <= identity_cache.ident; ident++)
            PR_DELETE(identity_cache.name[ident]);

        PR_DELETE(identity_cache.name);
    }
}  /* _PR_CleanupLayerCache */

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 249 of file prmwait.c.

{
    PR_DestroyLock(mw_lock);
    mw_lock = NULL;
    if (mw_state->group) {
        PR_DestroyWaitGroup(mw_state->group);
        /* mw_state->group is set to NULL as a side effect. */
    }
    PR_DELETE(mw_state);
}  /* _PR_CleanupMW */

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 440 of file prnetdb.c.

{
#if !defined(_PR_NO_DNS_LOCK)
    if (_pr_dnsLock) {
        PR_DestroyLock(_pr_dnsLock);
        _pr_dnsLock = NULL;
    }
#endif
#if !defined(_PR_HAVE_GETPROTO_R)
    if (_getproto_lock) {
        PR_DestroyLock(_getproto_lock);
        _getproto_lock = NULL;
    }
#endif
#if defined(_PR_INET6) && defined(_PR_HAVE_GETHOSTBYNAME2)
    if (_pr_query_ifs_lock) {
        PR_DestroyLock(_pr_query_ifs_lock);
        _pr_query_ifs_lock = NULL;
    }
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 64 of file prustack.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 59 of file prcthr.c.

{
    /* Free up per-thread-data */
    _PR_DestroyThreadPrivate(thread);

    /* Free any thread dump procs */
    if (thread->dumpArg) {
        PR_DELETE(thread->dumpArg);
    }
    thread->dump = 0;

    PR_DELETE(thread->errorString);
    thread->errorStringSize = 0;
    thread->errorStringLength = 0;
    thread->environment = NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 184 of file pruthr.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 634 of file prtime.c.

{
#ifdef HAVE_LOCALTIME_MONITOR
    if (monitor) {
        PR_DestroyLock(monitor);
        monitor = NULL;
    }
#endif

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 105 of file prtpd.c.

{
}  /* _PR_CleanupTPD */

Here is the caller graph for this function:

Definition at line 339 of file prucv.c.

{
    PRThread *thread, *me = _PR_MD_CURRENT_THREAD();
    _PRCPU *cpu = me->cpu;
    PRIntervalTime elapsed, now;
 
    PR_ASSERT(_PR_MD_GET_INTSOFF() != 0);
    /* Figure out how much time elapsed since the last clock tick */
    now = PR_IntervalNow();
    elapsed = now - cpu->last_clock;
    cpu->last_clock = now;

#ifndef XP_MAC
    PR_LOG(_pr_clock_lm, PR_LOG_MAX,
          ("ExpireWaits: elapsed=%lld usec", elapsed));
#endif

    while(1) {
        _PR_SLEEPQ_LOCK(cpu);
        if (_PR_SLEEPQ(cpu).next == &_PR_SLEEPQ(cpu)) {
            _PR_SLEEPQ_UNLOCK(cpu);
            break;
        }

        thread = _PR_THREAD_PTR(_PR_SLEEPQ(cpu).next);
        PR_ASSERT(thread->cpu == cpu);

        if (elapsed < thread->sleep) {
            thread->sleep -= elapsed;
            _PR_SLEEPQMAX(thread->cpu) -= elapsed;
            _PR_SLEEPQ_UNLOCK(cpu);
            break;
        }
        _PR_SLEEPQ_UNLOCK(cpu);

        PR_ASSERT(!_PR_IS_NATIVE_THREAD(thread));

        _PR_THREAD_LOCK(thread);

        if (thread->cpu != cpu) {
            /*
            ** The thread was switched to another CPU
            ** between the time we unlocked the sleep
            ** queue and the time we acquired the thread
            ** lock, so it is none of our business now.
            */
            _PR_THREAD_UNLOCK(thread);
            continue;
        }

        /*
        ** Consume this sleeper's amount of elapsed time from the elapsed
        ** time value. The next remaining piece of elapsed time will be
        ** available for the next sleeping thread's timer.
        */
        _PR_SLEEPQ_LOCK(cpu);
        PR_ASSERT(!(thread->flags & _PR_ON_PAUSEQ));
        if (thread->flags & _PR_ON_SLEEPQ) {
            _PR_DEL_SLEEPQ(thread, PR_FALSE);
            elapsed -= thread->sleep;
            _PR_SLEEPQ_UNLOCK(cpu);
        } else {
            /* Thread was already handled; Go get another one */
            _PR_SLEEPQ_UNLOCK(cpu);
            _PR_THREAD_UNLOCK(thread);
            continue;
        }

        /* Notify the thread waiting on the condition variable */
        if (thread->flags & _PR_SUSPENDING) {
              PR_ASSERT((thread->state == _PR_IO_WAIT) ||
                            (thread->state == _PR_COND_WAIT));
            /*
            ** Thread is suspended and its condition timeout
            ** expired. Transfer thread from sleepQ to suspendQ.
            */
            thread->wait.cvar = NULL;
            _PR_MISCQ_LOCK(cpu);
            thread->state = _PR_SUSPENDED;
            _PR_ADD_SUSPENDQ(thread, cpu);
            _PR_MISCQ_UNLOCK(cpu);
        } else {
            if (thread->wait.cvar) {
                PRThreadPriority pri;

                /* Do work very similar to what _PR_NotifyThread does */
                PR_ASSERT( !_PR_IS_NATIVE_THREAD(thread) );

                /* Make thread runnable */
                pri = thread->priority;
                thread->state = _PR_RUNNABLE;
                PR_ASSERT(!(thread->flags & _PR_IDLE_THREAD));

                PR_ASSERT(thread->cpu == cpu);
                _PR_RUNQ_LOCK(cpu);
                _PR_ADD_RUNQ(thread, cpu, pri);
                _PR_RUNQ_UNLOCK(cpu);

                if (pri > me->priority)
                    _PR_SET_RESCHED_FLAG();

                thread->wait.cvar = NULL;

                _PR_MD_WAKEUP_WAITER(thread);

            } else if (thread->io_pending == PR_TRUE) {
                /* Need to put IO sleeper back on runq */
                int pri = thread->priority;

                thread->io_suspended = PR_TRUE;
#ifdef WINNT
                            /*
                             * For NT, record the cpu on which I/O was issued
                             * I/O cancellation is done on the same cpu
                             */
                thread->md.thr_bound_cpu = cpu;
#endif

                            PR_ASSERT(!(thread->flags & _PR_IDLE_THREAD));
                PR_ASSERT(thread->cpu == cpu);
                thread->state = _PR_RUNNABLE;
                _PR_RUNQ_LOCK(cpu);
                _PR_ADD_RUNQ(thread, cpu, pri);
                _PR_RUNQ_UNLOCK(cpu);
            }
        }
        _PR_THREAD_UNLOCK(thread);
    }
}

Here is the caller graph for this function:

PRUint32 _PR_CondVarToString ( PRCondVar cvar,
char *  buf,
PRUint32  buflen 
)

Definition at line 322 of file prucv.c.

{
    PRUint32 nb;

    if (cvar->lock->owner) {
       nb = PR_snprintf(buf, buflen, "[%p] owner=%ld[%p]",
                      cvar, cvar->lock->owner->id, cvar->lock->owner);
    } else {
       nb = PR_snprintf(buf, buflen, "[%p]", cvar);
    }
    return nb;
}

Here is the call graph for this function:

PRSize _pr_CopyLowBits ( void dest,
PRSize  dstlen,
void src,
PRSize  srclen 
)

Definition at line 51 of file prrng.c.

{
    if (srclen <= dstlen) {
       memcpy(dst, src, srclen);
           return srclen;
    }
#if defined IS_BIG_ENDIAN
    memcpy(dst, (char*)src + (srclen - dstlen), dstlen);
#else
    memcpy(dst, src, dstlen);
#endif
    return dstlen;
}    

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 87 of file prseg.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 244 of file prtpd.c.

{
#define _PR_TPD_DESTRUCTOR_ITERATIONS 4

    if (NULL != self->privateData)  /* we have some */
    {
        PRBool clean;
        PRUint32 index;
        PRInt32 passes = _PR_TPD_DESTRUCTOR_ITERATIONS;
        PR_ASSERT(0 != self->tpdLength);
        do
        {
            clean = PR_TRUE;
            for (index = 0; index < self->tpdLength; ++index)
            {
                void *priv = self->privateData[index];  /* extract */
                if (NULL != priv)  /* we have data at this index */
                {
                    if (NULL != _pr_tpd_destructors[index])
                    {
                        self->privateData[index] = NULL;  /* precondition */
                        (*_pr_tpd_destructors[index])(priv);  /* destroy */
                        clean = PR_FALSE;  /* unknown side effects */
                    }
                }
            }
        } while ((--passes > 0) && !clean);  /* limit # of passes */
        /*
        ** We give up after a fixed number of passes. Any non-NULL
        ** thread-private data value with a registered destructor
        ** function is not destroyed.
        */
        memset(self->privateData, 0, self->tpdLength * sizeof(void*));
    }
}  /* _PR_DestroyThreadPrivate */

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 185 of file prustack.c.

{
    if (!ts) {
       return;
    }
    if (ts->flags & _PR_STACK_PRIMORDIAL) {
       PR_DELETE(ts);
       return;
    }

    /*
    ** Put the stack on the free list. This is done because we are still
    ** using the stack. Next time a thread is created we will trim the
    ** list down; it's safe to do it then because we will have had to
    ** context switch to a live stack before another thread can be
    ** created.
    */
    PR_Lock(_pr_stackLock);
    PR_APPEND_LINK(&ts->links, _pr_freeStacks.prev);
    _pr_numFreeStacks++;
    PR_Unlock(_pr_stackLock);
}

Here is the caller graph for this function:

Definition at line 79 of file prfdcach.c.

{
    PRFileDesc *fd;
    /*
    ** $$$
    ** This may look a little wasteful. We'll see. Right now I want to
    ** be able to toggle between caching and not at runtime to measure
    ** the differences. If it isn't too annoying, I'll leave it in.
    ** $$$$
    **
    ** The test is against _pr_fd_cache.limit_high. If that's zero,
    ** we're not doing the extended cache but going for performance.
    */
    if (0 == _pr_fd_cache.limit_high)
    {
        PRStackElem *pop;
        PR_ASSERT(NULL != _pr_fd_cache.stack);
        pop = PR_StackPop(_pr_fd_cache.stack);
        if (NULL == pop) goto allocate;
        fd = (PRFileDesc*)((PRPtrdiff)pop - (PRPtrdiff)stack2fd);
    }
    else
    {
        do
        {
            if (NULL == _pr_fd_cache.head) goto allocate;  /* nothing there */
            if (_pr_fd_cache.count < _pr_fd_cache.limit_low) goto allocate;

            /* we "should" be able to extract an fd from the cache */
            PR_Lock(_pr_fd_cache.ml);  /* need the lock to do this safely */
            fd = _pr_fd_cache.head;  /* protected extraction */
            if (NULL == fd)  /* unexpected, but not fatal */
            {
                PR_ASSERT(0 == _pr_fd_cache.count);
                PR_ASSERT(NULL == _pr_fd_cache.tail);
            }
            else
            {
                _pr_fd_cache.count -= 1;
                _pr_fd_cache.head = fd->higher;
                if (NULL == _pr_fd_cache.head)
                {
                    PR_ASSERT(0 == _pr_fd_cache.count);
                    _pr_fd_cache.tail = NULL;
                }
                PR_ASSERT(&_pr_faulty_methods == fd->methods);
                PR_ASSERT(PR_INVALID_IO_LAYER == fd->identity);
                PR_ASSERT(_PR_FILEDESC_FREED == fd->secret->state);
            }
            PR_Unlock(_pr_fd_cache.ml);

        } while (NULL == fd);  /* then go around and allocate a new one */
    }

finished:
    fd->dtor = NULL;
    fd->lower = fd->higher = NULL;
    fd->identity = PR_NSPR_IO_LAYER;
    memset(fd->secret, 0, sizeof(PRFilePrivate));
    return fd;

allocate:
    fd = PR_NEW(PRFileDesc);
    if (NULL != fd)
    {
        fd->secret = PR_NEW(PRFilePrivate);
        if (NULL == fd->secret) PR_DELETE(fd);
    }
    if (NULL != fd) goto finished;
    else return NULL;

}  /* _PR_Getfd */

Here is the call graph for this function:

Definition at line 257 of file prinit.c.

{
       _PR_InitStuff();

    /* Enable interrupts */
#if !defined(_PR_PTHREADS) && !defined(_PR_GLOBAL_THREADS_ONLY)
    _PR_MD_START_INTERRUPTS();
#endif

}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 298 of file pratom.c.

Here is the caller graph for this function:

Definition at line 54 of file prinrval.c.

{
    _PR_MD_INTERVAL_INIT();
#ifdef DEBUG
    {
        PRIntervalTime ticksPerSec = PR_TicksPerSecond();

        PR_ASSERT(ticksPerSec >= PR_INTERVAL_MIN);
        PR_ASSERT(ticksPerSec <= PR_INTERVAL_MAX);
    }
#endif /* DEBUG */
}

Here is the caller graph for this function:

Definition at line 304 of file prcmon.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 72 of file prucpu.c.

{
    PRThread *me = _PR_MD_CURRENT_THREAD();

    if (_native_threads_only)
        return;

    _pr_cpuID = 0;
    _MD_NEW_LOCK( &_pr_cpuLock);
#if !defined(_PR_LOCAL_THREADS_ONLY) && !defined(_PR_GLOBAL_THREADS_ONLY)
#ifndef _PR_HAVE_ATOMIC_OPS
    _MD_NEW_LOCK(&_pr_md_idle_cpus_lock);
#endif
#endif

#ifdef _PR_LOCAL_THREADS_ONLY

#ifdef HAVE_CUSTOM_USER_THREADS
    _PR_MD_CREATE_PRIMORDIAL_USER_THREAD(me);
#endif

    /* Now start the first CPU. */
    _pr_primordialCPU = _PR_CreateCPU();
    _pr_numCPU = 1;
    _PR_StartCPU(_pr_primordialCPU, me);

    _PR_MD_SET_CURRENT_CPU(_pr_primordialCPU);

    /* Initialize cpu for current thread (could be different from me) */
    _PR_MD_CURRENT_THREAD()->cpu = _pr_primordialCPU;

    _PR_MD_SET_LAST_THREAD(me);

#else /* Combined MxN model */

    _pr_primordialCPU = _PR_CreateCPU();
    _pr_numCPU = 1;
    _PR_CreateThread(PR_SYSTEM_THREAD,
                     _PR_RunCPU,
                     _pr_primordialCPU,
                     PR_PRIORITY_NORMAL,
                     PR_GLOBAL_THREAD,
                     PR_UNJOINABLE_THREAD,
                     0,
                     _PR_IDLE_THREAD);

#endif /* _PR_LOCAL_THREADS_ONLY */

    _PR_MD_INIT_CPUS();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 46 of file prdtoa.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 65 of file prenv.c.

Here is the caller graph for this function:

Definition at line 254 of file prfdcach.c.

{
    /*
    ** The fd caching is enabled by default for DEBUG builds,
    ** disabled by default for OPT builds. That default can
    ** be overridden at runtime using environment variables
    ** or a super-wiz-bang API.
    */
    const char *low = PR_GetEnv("NSPR_FD_CACHE_SIZE_LOW");
    const char *high = PR_GetEnv("NSPR_FD_CACHE_SIZE_HIGH");

    /* 
    ** _low is allowed to be zero, _high is not.
    ** If _high is zero, we're not doing the caching.
    */

    _pr_fd_cache.limit_low = 0;
#if defined(DEBUG)
    _pr_fd_cache.limit_high = FD_SETSIZE;
#else
    _pr_fd_cache.limit_high = 0;
#endif  /* defined(DEBUG) */

    if (NULL != low) _pr_fd_cache.limit_low = atoi(low);
    if (NULL != high) _pr_fd_cache.limit_high = atoi(high);

    if (_pr_fd_cache.limit_low < 0)
        _pr_fd_cache.limit_low = 0;
    if (_pr_fd_cache.limit_low > FD_SETSIZE)
        _pr_fd_cache.limit_low = FD_SETSIZE;

    if (_pr_fd_cache.limit_high > FD_SETSIZE)
        _pr_fd_cache.limit_high = FD_SETSIZE;

    if (_pr_fd_cache.limit_high < _pr_fd_cache.limit_low)
        _pr_fd_cache.limit_high = _pr_fd_cache.limit_low;

    _pr_fd_cache.ml = PR_NewLock();
    PR_ASSERT(NULL != _pr_fd_cache.ml);
    _pr_fd_cache.stack = PR_CreateStack("FD");
    PR_ASSERT(NULL != _pr_fd_cache.stack);

}  /* _PR_InitFdCache */

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 48 of file prio.c.

{
    const PRIOMethods *methods = PR_GetFileMethods();

    _PR_InitFdCache();

    _pr_flock_lock = PR_NewLock();
    _pr_flock_cv = PR_NewCondVar(_pr_flock_lock);

#ifdef WIN32
    _pr_stdin = PR_AllocFileDesc((PRInt32)GetStdHandle(STD_INPUT_HANDLE),
            methods);
    _pr_stdout = PR_AllocFileDesc((PRInt32)GetStdHandle(STD_OUTPUT_HANDLE),
            methods);
    _pr_stderr = PR_AllocFileDesc((PRInt32)GetStdHandle(STD_ERROR_HANDLE),
            methods);
#ifdef WINNT
    _pr_stdin->secret->md.sync_file_io = PR_TRUE;
    _pr_stdout->secret->md.sync_file_io = PR_TRUE;
    _pr_stderr->secret->md.sync_file_io = PR_TRUE;
#endif
#else
    _pr_stdin = PR_AllocFileDesc(0, methods);
    _pr_stdout = PR_AllocFileDesc(1, methods);
    _pr_stderr = PR_AllocFileDesc(2, methods);
#endif
    _PR_MD_INIT_FD_INHERITABLE(_pr_stdin, PR_TRUE);
    _PR_MD_INIT_FD_INHERITABLE(_pr_stdout, PR_TRUE);
    _PR_MD_INIT_FD_INHERITABLE(_pr_stderr, PR_TRUE);

    _PR_MD_INIT_IO();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 742 of file prlayer.c.

{
    memset(&identity_cache, 0, sizeof(identity_cache));
    identity_cache.ml = PR_NewLock();
    PR_ASSERT(NULL != identity_cache.ml);
}  /* _PR_InitLayerCache */

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 256 of file prlink.c.

{
    PRLibrary *lm = NULL;
#if defined(XP_UNIX)
    void *h;
#endif

#ifdef WIN95
    if (!_pr_useUnicode) {
        loadLibraryW = EmulateLoadLibraryW;
    }
#endif

    if (!pr_linker_lock) {
        pr_linker_lock = PR_NewNamedMonitor("linker-lock");
    }
    PR_EnterMonitor(pr_linker_lock);

#if defined(XP_PC)
    lm = PR_NEWZAP(PRLibrary);
    lm->name = strdup("Executable");
        /* 
        ** In WIN32, GetProcAddress(...) expects a module handle in order to
        ** get exported symbols from the executable...
        **
        ** However, in WIN16 this is accomplished by passing NULL to 
        ** GetProcAddress(...)
        */
#if defined(_WIN32)
        lm->dlh = GetModuleHandle(NULL);
#else
        lm->dlh = (HINSTANCE)NULL;
#endif /* ! _WIN32 */

    lm->refCount    = 1;
    lm->staticTable = NULL;
    pr_exe_loadmap  = lm;
    pr_loadmap      = lm;

#elif defined(XP_UNIX)
#ifdef HAVE_DLL
#ifdef USE_DLFCN
    h = dlopen(0, RTLD_LAZY);
    if (!h) {
        char *error;
        
        DLLErrorInternal(_MD_ERRNO());
        error = (char*)PR_MALLOC(PR_GetErrorTextLength());
        (void) PR_GetErrorText(error);
        fprintf(stderr, "failed to initialize shared libraries [%s]\n",
            error);
        PR_DELETE(error);
        abort();/* XXX */
    }
#elif defined(USE_HPSHL)
    h = NULL;
    /* don't abort with this NULL */
#elif defined(USE_MACH_DYLD)
    h = NULL; /* XXXX  toshok */
#else
#error no dll strategy
#endif /* USE_DLFCN */

    lm = PR_NEWZAP(PRLibrary);
    if (lm) {
        lm->name = strdup("a.out");
        lm->refCount = 1;
        lm->dlh = h;
        lm->staticTable = NULL;
    }
    pr_exe_loadmap = lm;
    pr_loadmap = lm;
#endif /* HAVE_DLL */
#endif /* XP_UNIX */

    if (lm) {
        PR_LOG(_pr_linker_lm, PR_LOG_MIN,
            ("Loaded library %s (init)", lm->name));
    }

    PR_ExitMonitor(pr_linker_lock);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 50 of file btlocks.c.

{
}

Here is the caller graph for this function:

Definition at line 205 of file prlog.c.

{
    char *ev;

    _pr_logLock = PR_NewLock();

    ev = PR_GetEnv("NSPR_LOG_MODULES");
    if (ev && ev[0]) {
        char module[64];  /* Security-Critical: If you change this
                           * size, you must also change the sscanf
                           * format string to be size-1.
                           */
        PRBool isSync = PR_FALSE;
        PRIntn evlen = strlen(ev), pos = 0;
        PRInt32 bufSize = DEFAULT_BUF_SIZE;
        while (pos < evlen) {
            PRIntn level = 1, count = 0, delta = 0;
            count = sscanf(&ev[pos], "%63[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-]%n:%d%n",
                           module, &delta, &level, &delta);
            pos += delta;
            if (count == 0) break;

            /*
            ** If count == 2, then we got module and level. If count
            ** == 1, then level defaults to 1 (module enabled).
            */
            if (strcasecmp(module, "sync") == 0) {
                isSync = PR_TRUE;
            } else if (strcasecmp(module, "bufsize") == 0) {
                if (level >= LINE_BUF_SIZE) {
                    bufSize = level;
                }
            } else {
                PRLogModuleInfo *lm = logModules;
                PRBool skip_modcheck =
                    (0 == strcasecmp (module, "all")) ? PR_TRUE : PR_FALSE;

                while (lm != NULL) {
                    if (skip_modcheck) lm -> level = (PRLogModuleLevel)level;
                    else if (strcasecmp(module, lm->name) == 0) {
                        lm->level = (PRLogModuleLevel)level;
                        break;
                    }
                    lm = lm->next;
                }
            }
            /*found:*/
            count = sscanf(&ev[pos], " , %n", &delta);
            pos += delta;
            if (count == EOF) break;
        }
        PR_SetLogBuffering(isSync ? bufSize : 0);

#ifdef XP_UNIX
        if ((getuid() != geteuid()) || (getgid() != getegid())) {
            return;
        }
#endif /* XP_UNIX */

        ev = PR_GetEnv("NSPR_LOG_FILE");
        if (ev && ev[0]) {
            if (!PR_SetLogFile(ev)) {
#ifdef XP_PC
                char* str = PR_smprintf("Unable to create nspr log file '%s'\n", ev);
                if (str) {
                    OutputDebugString(str);
                    PR_smprintf_free(str);
                }
#else
                fprintf(stderr, "Unable to create nspr log file '%s'\n", ev);
#endif
            }
        } else {
#ifdef _PR_USE_STDIO_FOR_LOGGING
            logFile = stderr;
#else
            logFile = _pr_stderr;
#endif
        }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Definition at line 231 of file prmwait.c.

{
#ifdef WINNT
    /*
     * We use NT 4's InterlockedCompareExchange() to operate
     * on PRMWStatus variables.
     */
    PR_ASSERT(sizeof(PVOID) == sizeof(PRMWStatus));
    TimerInit();
#endif
    mw_lock = PR_NewLock();
    PR_ASSERT(NULL != mw_lock);
    mw_state = PR_NEWZAP(_PRGlobalState);
    PR_ASSERT(NULL != mw_state);
    PR_INIT_CLIST(&mw_state->group_list);
    max_polling_interval = PR_MillisecondsToInterval(MAX_POLLING_INTERVAL);
}  /* _PR_InitMW */

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 418 of file prnetdb.c.

{
#if defined(XP_UNIX)
#ifdef HAVE_NETCONFIG
       /*
        * This one-liner prevents the endless re-open's and re-read's of
        * /etc/netconfig on EACH and EVERY call to accept(), connect(), etc.
        */
        (void)setnetconfig();
#endif
#endif
#if !defined(_PR_NO_DNS_LOCK)
       _pr_dnsLock = PR_NewLock();
#endif
#if !defined(_PR_HAVE_GETPROTO_R)
       _getproto_lock = PR_NewLock();
#endif
#if defined(_PR_INET6) && defined(_PR_HAVE_GETHOSTBYNAME2)
       _pr_query_ifs_lock = PR_NewLock();
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 389 of file prrwlock.c.

{ }

Here is the caller graph for this function:

Definition at line 51 of file prseg.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 58 of file btmisc.c.

{
}

Here is the call graph for this function:

Here is the caller graph for this function:

void _PR_InitThreads ( PRThreadType  type,
PRThreadPriority  priority,
PRUintn  maxPTDs 
)

Definition at line 91 of file btthread.c.

{
    PRThread *primordialThread;
    PRUint32  beThreadPriority;

       /* allocate joinSem mutex */
       joinSemLock = PR_NewLock();
       if (joinSemLock == NULL)
       {
              PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
              return;
    }

    /*
    ** Create and initialize NSPR structure for our primordial thread.
    */
    
    primordialThread = PR_NEWZAP(PRThread);
    if( NULL == primordialThread )
    {
        PR_SetError( PR_OUT_OF_MEMORY_ERROR, 0 );
        return;
    }

       primordialThread->md.joinSem = B_ERROR;

    /*
    ** Set the priority to the desired level.
    */

    beThreadPriority = _bt_MapNSPRToNativePriority( priority );
    
    set_thread_priority( find_thread( NULL ), beThreadPriority );
    
    primordialThread->priority = priority;


       /* set the thread's state - note that the thread is not joinable */
    primordialThread->state |= BT_THREAD_PRIMORD;
       if (type == PR_SYSTEM_THREAD)
              primordialThread->state |= BT_THREAD_SYSTEM;

    /*
    ** Allocate a TLS slot for the PRThread structure (just using
    ** native TLS, as opposed to NSPR TPD, will make PR_GetCurrentThread()
    ** somewhat faster, and will leave one more TPD slot for our client)
    */
       
       tls_prThreadSlot = tls_allocate();

    /*
    ** Stuff our new PRThread structure into our thread specific
    ** slot.
    */

       tls_set(tls_prThreadSlot, primordialThread);
    
       /* allocate lock for bt_book */
    bt_book.ml = PR_NewLock();
    if( NULL == bt_book.ml )
    {
       PR_SetError( PR_OUT_OF_MEMORY_ERROR, 0 );
       return;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 627 of file prtime.c.

{
#ifdef HAVE_LOCALTIME_MONITOR
    monitor = PR_NewLock();
#endif

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 64 of file btmisc.c.

{
}

Here is the caller graph for this function:

void _PR_IntsOn ( _PRCPU cpu)

Definition at line 60 of file prulock.c.

{
    PRUintn missed, pri, i;
    _PRInterruptTable *it;
    PRThread *me;

    PR_ASSERT(cpu);   /* Global threads don't have CPUs */
    PR_ASSERT(_PR_MD_GET_INTSOFF() > 0);
       me = _PR_MD_CURRENT_THREAD();
#if !defined(XP_MAC)
    PR_ASSERT(!(me->flags & _PR_IDLE_THREAD));
#endif

    /*
    ** Process delayed interrupts. This logic is kinda scary because we
    ** need to avoid losing an interrupt (it's ok to delay an interrupt
    ** until later).
    **
    ** There are two missed state words. _pr_ints.where indicates to the
    ** interrupt handler which state word is currently safe for
    ** modification.
    **
    ** This code scans both interrupt state words, using the where flag
    ** to indicate to the interrupt which state word is safe for writing.
    ** If an interrupt comes in during a scan the other word will be
    ** modified. This modification will be noticed during the next
    ** iteration of the loop or during the next call to this routine.
    */
    for (i = 0; i < 2; i++) {
        cpu->where = (1 - i);
        missed = cpu->u.missed[i];
        if (missed != 0) {
            cpu->u.missed[i] = 0;
            for (it = _pr_interruptTable; it->name; it++) {
                if (missed & it->missed_bit) {
#ifndef XP_MAC
                    PR_LOG(_pr_sched_lm, PR_LOG_MIN,
                           ("IntsOn[0]: %s intr", it->name));
#endif
                    (*it->handler)();
                }
            }
        }
    }

    if (cpu->u.missed[3] != 0) {
        _PRCPU *cpu;

              _PR_THREAD_LOCK(me);
        me->state = _PR_RUNNABLE;
        pri = me->priority;

        cpu = me->cpu;
              _PR_RUNQ_LOCK(cpu);
        _PR_ADD_RUNQ(me, cpu, pri);
              _PR_RUNQ_UNLOCK(cpu);
              _PR_THREAD_UNLOCK(me);
        _PR_MD_SWITCH_CONTEXT(me);
    }
}

Here is the call graph for this function:

Definition at line 122 of file priometh.c.

{
    PR_ASSERT(!"I/O method is invalid");
    PR_SetError(PR_INVALID_METHOD_ERROR, 0);
    return NULL;
}  /* _PR_InvalidDesc */
PRIntn _PR_InvalidInt ( void  )

Definition at line 84 of file priometh.c.

{
    PR_ASSERT(!"I/O method is invalid");
    PR_SetError(PR_INVALID_METHOD_ERROR, 0);
    return -1;
}  /* _PR_InvalidInt */

Definition at line 91 of file priometh.c.

{
    PR_ASSERT(!"I/O method is invalid");
    PR_SetError(PR_INVALID_METHOD_ERROR, 0);
    return -1;
}  /* _PR_InvalidInt */

Definition at line 98 of file priometh.c.

{
    PRInt64 rv;
    LL_I2L(rv, -1);
    PR_ASSERT(!"I/O method is invalid");
    PR_SetError(PR_INVALID_METHOD_ERROR, 0);
    return rv;
}  /* _PR_InvalidInt */

Definition at line 111 of file priometh.c.

{
    PR_ASSERT(!"I/O method is invalid");
    PR_SetError(PR_INVALID_METHOD_ERROR, 0);
    return PR_FAILURE;
}  /* _PR_InvalidDesc */

Definition at line 287 of file prlog.c.

{
    PRLogModuleInfo *lm = logModules;

    PR_LogFlush();

#ifdef _PR_USE_STDIO_FOR_LOGGING
    if (logFile
        && logFile != stdout
        && logFile != stderr
#ifdef XP_PC
        && logFile != WIN32_DEBUG_FILE
#endif
        ) {
        fclose(logFile);
        logFile = NULL;
    }
#else
    if (logFile && logFile != _pr_stdout && logFile != _pr_stderr) {
        PR_Close(logFile);
        logFile = NULL;
    }
#endif

    while (lm != NULL) {
        PRLogModuleInfo *next = lm->next;
        free((/*const*/ char *)lm->name);
        PR_Free(lm);
        lm = next;
    }
    logModules = NULL;

    if (_pr_logLock) {
        PR_DestroyLock(_pr_logLock);
        _pr_logLock = NULL;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRStatus _PR_MakeNativeIPCName ( const char *  name,
char *  result,
PRIntn  size,
_PRIPCType  type 
)

Definition at line 109 of file pripc.c.

{
    if (strlen(name) >= (PRSize)size) {
        PR_SetError(PR_BUFFER_OVERFLOW_ERROR, 0);
        return PR_FAILURE;
    }
    strcpy(result, name);
    switch (type) {
        case _PRIPCSem:
            _pr_ConvertSemName(result);
            break;
        case _PRIPCShm:
            _pr_ConvertShmName(result);
            break;
        default:
            PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
            return PR_FAILURE;
    }
    return PR_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRStatus _PR_MapOptionName ( PRSockOption  optname,
PRInt32 level,
PRInt32 name 
)

Definition at line 484 of file prmapopt.c.

Here is the caller graph for this function:

PRInt32 _PR_MD_ACCEPT ( PRFileDesc fd,
PRNetAddr addr,
PRUint32 addrlen,
PRIntervalTime  timeout 
)

Definition at line 170 of file w16sock.c.

{
    PRInt32 osfd = fd->secret->md.osfd;
    PRThread    *me = _PR_MD_CURRENT_THREAD();
    PRInt32     err;
    PRIntn      rv;

    MD_ASSERTINT( *addrlen );    

    while ((rv = (SOCKET)accept(osfd, (struct sockaddr *) addr,
                                        (int *)addrlen)) == INVALID_SOCKET ) {
        err = WSAGetLastError();
              if ( err == WSAEWOULDBLOCK ) {
                     if (fd->secret->nonblocking) {
                            break;
                     }
            if (_PR_WaitForFD(osfd, PR_POLL_READ, timeout) == 0) {
                if ( _PR_PENDING_INTERRUPT(me))
                {
                    me->flags &= ~_PR_INTERRUPT;
                    PR_SetError( PR_PENDING_INTERRUPT_ERROR, 0);
                } else
                {
                    PR_SetError(PR_IO_TIMEOUT_ERROR, 0);
                }
                rv = -1;
                goto done;
            } else if (_PR_PENDING_INTERRUPT(me)) {
                me->flags &= ~_PR_INTERRUPT;
                PR_SetError( PR_PENDING_INTERRUPT_ERROR, 0);
                rv = -1;
                goto done;
            }
        } else if ((err == WSAEINTR) && (!_PR_PENDING_INTERRUPT(me))){
            continue;
        } else {
            break;
        }
    }
    if (rv < 0) {
        _PR_MD_MAP_ACCEPT_ERROR(err);
    }
done:
    if ( rv == INVALID_SOCKET )
        return(-1 );
    else
        return(rv);
} /* end _MD_Accept() */

Here is the call graph for this function:

PRInt32 _PR_MD_ACCEPT_READ ( PRFileDesc sd,
PRInt32 newSock,
PRNetAddr **  raddr,
void buf,
PRInt32  amount,
PRIntervalTime  timeout 
)

Here is the caller graph for this function:

PRInt32 _PR_MD_ACCESS ( const char *  name,
PRAccessHow  how 
)

Definition at line 783 of file os2io.c.

{
  PRInt32 rv;
    switch (how) {
      case PR_ACCESS_WRITE_OK:
        rv = access(name, 02);
              break;
      case PR_ACCESS_READ_OK:
        rv = access(name, 04);
              break;
      case PR_ACCESS_EXISTS:
        return access(name, 00);
              break;
      default:
              PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
              return -1;
    }
       if (rv < 0)
              _PR_MD_MAP_ACCESS_ERROR(errno);
    return rv;
}
PRStatus _PR_MD_ALLOC_SEGMENT ( PRSegment seg,
PRUint32  size,
void vaddr 
)

Here is the caller graph for this function:

Definition at line 253 of file pratom.c.

Here is the call graph for this function:

Definition at line 267 of file pratom.c.

Here is the call graph for this function:

Definition at line 239 of file pratom.c.

Here is the call graph for this function:

Definition at line 281 of file pratom.c.

Here is the call graph for this function:

PRInt32 _PR_MD_BIND ( PRFileDesc fd,
const PRNetAddr addr,
PRUint32  addrlen 
)

Definition at line 366 of file os2sock.c.

{
    PRInt32 rv, err;
    rv = bind(fd->secret->md.osfd, (struct sockaddr *) addr, (int )addrlen);
    if (rv < 0) {
        err = sock_errno();
        _PR_MD_MAP_BIND_ERROR(err);
    }
    return(rv);
}

Here is the call graph for this function:

Definition at line 293 of file os2thred.c.

{
    APIRET rv;

    if (thread->md.blocked_sema) {
        rv = DosCloseEventSem(thread->md.blocked_sema);
        PR_ASSERT(rv == NO_ERROR);
        thread->md.blocked_sema = 0;
    }

    if (thread->md.handle) {
        thread->md.handle = 0;
    }
}

Definition at line 135 of file ntthread.c.

{
    _PR_NT_FreeSids();

    WSACleanup();

    if (!_pr_use_static_tls) {
        TlsFree(_pr_currentFiberIndex);
        TlsFree(_pr_lastFiberIndex);
        TlsFree(_pr_currentCPUIndex);
        TlsFree(_pr_intsOffIndex);
        TlsFree(_pr_io_restartedIOIndex);
    }
}

Here is the call graph for this function:

Definition at line 459 of file os2io.c.

{
   PRInt32 rc;

    if ( d ) {
      rc = DosFindClose(d->d_hdl);
      if(rc == NO_ERROR){
        d->magic = (PRUint32)-1;
        return PR_SUCCESS;
              } else {
                     _PR_MD_MAP_CLOSEDIR_ERROR(rc);
              return PR_FAILURE;
              }
    }
    PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
    return PR_FAILURE;
}

Here is the call graph for this function:

Definition at line 292 of file w16io.c.

{
    PRInt32     rv;
    
    rv = (PRInt32) close( osfd );
    if ( rv == -1 )
    {
        _PR_MD_MAP_CLOSE_ERROR( errno );
    }
    PR_Sleep( _PR_MD_WIN16_DELAY );    
    return(rv);
} /* --- end _MD_CloseFile() --- */

Here is the call graph for this function:

Definition at line 69 of file bmmap.c.

{
    PR_SetError( PR_NOT_IMPLEMENTED_ERROR, 0 );
    return PR_FAILURE;
}

Definition at line 219 of file w32ipcsem.c.

{
    if (CloseHandle(sem->sem) == FALSE) {
        _PR_MD_MAP_CLOSE_ERROR(GetLastError());
        return PR_FAILURE;
    }
    PR_DELETE(sem);
    return PR_SUCCESS;
}

Definition at line 146 of file w16sock.c.

{
    PRInt32 rv;

    rv = closesocket((SOCKET) osfd );
    if (rv < 0)
        _PR_MD_MAP_CLOSE_ERROR(WSAGetLastError());

    return rv;
}

Here is the call graph for this function:

PRInt32 _PR_MD_CONNECT ( PRFileDesc fd,
const PRNetAddr addr,
PRUint32  addrlen,
PRIntervalTime  timeout 
)

Definition at line 298 of file os2sock.c.

{
    PRInt32 rv, err;
    PRThread *me = _PR_MD_CURRENT_THREAD();
    PRInt32 osfd = fd->secret->md.osfd;
    PRNetAddr addrCopy = *addr; /* Work around a bug in OS/2 where connect
                                 * modifies the sockaddr structure.
                                 * See Bugzilla bug 100776. */

     /*
      * We initiate the connection setup by making a nonblocking connect()
      * call.  If the connect() call fails, there are two cases we handle
      * specially:
      * 1. The connect() call was interrupted by a signal.  In this case
      *    we simply retry connect().
      * 2. The NSPR socket is nonblocking and connect() fails with
      *    EINPROGRESS.  We first wait until the socket becomes writable.
      *    Then we try to find out whether the connection setup succeeded
      *    or failed.
      */

retry:
    if ((rv = connect(osfd, (struct sockaddr *)&addrCopy, addrlen)) == -1)
    {
        err = sock_errno();

        if (err == EINTR) {
            if (_PR_PENDING_INTERRUPT(me)) {
                me->flags &= ~_PR_INTERRUPT;
                PR_SetError( PR_PENDING_INTERRUPT_ERROR, 0);
                return -1;
            }
            goto retry;
        }

        if (!fd->secret->nonblocking && (err == EINPROGRESS))
        {
            /*
             * socket_io_wait() may return -1 or 1.
             */

            rv = socket_io_wait(osfd, WRITE_FD, timeout);
            if (rv == -1) {
                return -1;
            }

            PR_ASSERT(rv == 1);
            if (_PR_PENDING_INTERRUPT(me)) {
                me->flags &= ~_PR_INTERRUPT;
                PR_SetError( PR_PENDING_INTERRUPT_ERROR, 0);
                return -1;
            }
            err = _MD_os2_get_nonblocking_connect_error(osfd);
            if (err != 0) {
                _PR_MD_MAP_CONNECT_ERROR(err);
                return -1;
            }
            return 0;
        }
        
        _PR_MD_MAP_CONNECT_ERROR(err);
    }

    return rv;
}  /* _MD_connect */

Here is the call graph for this function:

Definition at line 41 of file bmmap.c.

{
    PR_SetError( PR_NOT_IMPLEMENTED_ERROR, 0 );
    return PR_FAILURE;
}
PRProcess* _PR_MD_CREATE_PROCESS ( const char *  path,
char *const argv,
char *const envp,
const PRProcessAttr attr 
)

Here is the caller graph for this function:

PRStatus _PR_MD_CREATE_THREAD ( PRThread thread,
void(*)(void *)  start,
PRThreadPriority  priority,
PRThreadScope  scope,
PRThreadState  state,
PRUint32  stackSize 
)

Definition at line 216 of file os2thred.c.

{
    PARAMSTORE* params = PR_Malloc(sizeof(PARAMSTORE));
    params->start = start;
    params->thread = thread;
#ifdef XP_OS2_VACPP /* No exception handler for VACPP */
    thread->md.handle = thread->id = (TID) _beginthread(
                    (void(* _Optlink)(void*))start,
                    NULL, 
                    thread->stack->stackSize,
                    thread);
#else
    thread->md.handle = thread->id = (TID) _beginthread(ExcpStartFunc,
                                                        NULL, 
                                                        thread->stack->stackSize,
                                                        params);
#endif
    if(thread->md.handle == -1) {
        return PR_FAILURE;
    }

    /*
     * On OS/2, a thread is created with a thread priority of
     * THREAD_PRIORITY_NORMAL
     */

    if (priority != PR_PRIORITY_NORMAL) {
        _PR_MD_SET_PRIORITY(&(thread->md), priority);
    }

    return PR_SUCCESS;
}

Here is the call graph for this function:

PRInt32 _PR_MD_DELETE ( const char *  name)

Definition at line 571 of file os2io.c.

{
    PRInt32 rc = DosDelete((char*)name);
    if(rc == NO_ERROR) {
        return 0;
    } else {
              _PR_MD_MAP_DELETE_ERROR(rc);
        return -1;
    }
}

Here is the call graph for this function:

Definition at line 82 of file pripcsem.c.

{
    PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
    return PR_FAILURE;
}

Definition at line 71 of file os2thred.c.

{
   HMODULE hmod;

   if (DosLoadModule(NULL, 0, "DOSCALL1", &hmod) == 0)
       DosQueryProcAddr(hmod, 877, "DOSQUERYTHREADCONTEXT",
                        (PFN *)&QueryThreadContext);

#ifdef XP_OS2_VACPP
   _tzset();
#endif
}

Here is the call graph for this function:

Definition at line 266 of file ntthread.c.

{
    _endthreadex(0);
}
void _PR_MD_EXIT ( PRIntn  status)

Definition at line 317 of file os2thred.c.

{
    _exit(status);
}

Definition at line 309 of file os2thred.c.

Here is the caller graph for this function:

Definition at line 412 of file os2io.c.

{
    PRInt32 rc = DosResetBuffer((HFILE)fd->secret->md.osfd);

    if (rc != NO_ERROR) {
       if (rc != ERROR_ACCESS_DENIED) {   
                     _PR_MD_MAP_FSYNC_ERROR(rc);
           return -1;
       }
    }
    return 0;
}

Here is the call graph for this function:

char* _PR_MD_GET_ENV ( const char *  name)

Definition at line 52 of file os2misc.c.

{
    return getenv(name);
}

Definition at line 79 of file os2inrval.c.

{
    if (useHighResTimer) {
        QWORD timestamp;
        PRInt32 top;
        APIRET rc = DosTmrQueryTime(&timestamp);
        if (NO_ERROR != rc) {
            return -1;
        }
        /* Sadly, nspr requires the interval to range from 1000 ticks per
         * second to only 100000 ticks per second. DosTmrQueryTime is too
         * high resolution...
         */
        top = timestamp.ulHi & _os2_highMask;
        top = top << (32 - _os2_bitShift);
        timestamp.ulLo = timestamp.ulLo >> _os2_bitShift;   
        timestamp.ulLo = timestamp.ulLo + top; 
        return (PRUint32)timestamp.ulLo;
    } else {
        ULONG msCount = -1;
        DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, &msCount, sizeof(msCount));
        return msCount;
    }
}

Definition at line 48 of file bmmap.c.

{
    PR_SetError( PR_NOT_IMPLEMENTED_ERROR, 0 );
    return -1;
}
void* _PR_MD_GET_SP ( PRThread thread)

Here is the caller graph for this function:

PRInt32 _PR_MD_GETFILEINFO ( const char *  fn,
PRFileInfo info 
)

Definition at line 626 of file os2io.c.

{
    struct stat sb;
    PRInt32 rv;
    PRInt64 s, s2us;
 
    if ( (rv = _PR_MD_STAT(fn, &sb)) == 0 ) {
        if (info) {
            if (S_IFREG & sb.st_mode)
                info->type = PR_FILE_FILE ;
            else if (S_IFDIR & sb.st_mode)
                info->type = PR_FILE_DIRECTORY;
            else
                info->type = PR_FILE_OTHER;
            info->size = sb.st_size;
            LL_I2L(s2us, PR_USEC_PER_SEC);
            LL_I2L(s, sb.st_mtime);
            LL_MUL(s, s, s2us);
            info->modifyTime = s;
            LL_I2L(s, sb.st_ctime);
            LL_MUL(s, s, s2us);
            info->creationTime = s;
        }
    }
    return rv;
}

Here is the call graph for this function:

PRInt32 _PR_MD_GETFILEINFO64 ( const char *  fn,
PRFileInfo64 info 
)

Definition at line 654 of file os2io.c.

{
    PRFileInfo info32;
    PRInt32 rv = _PR_MD_GETFILEINFO(fn, &info32);
    if (rv != 0)
    {
        return rv;
    }
    info->type = info32.type;
    LL_UI2L(info->size,info32.size);
    info->modifyTime = info32.modifyTime;
    info->creationTime = info32.creationTime;
    
    if (isWSEB)
    {
        APIRET rc ;
        FILESTATUS3L fstatus;

        rc = DosQueryPathInfo(fn, FIL_STANDARDL, &fstatus, sizeof(fstatus));

        if (NO_ERROR != rc)
        {
            _PR_MD_MAP_OPEN_ERROR(rc);
            return -1;
        }

        if (! (fstatus.attrFile & FILE_DIRECTORY))
        {
            info->size = fstatus.cbFile;
        }
    }

    return rv;
}

Here is the call graph for this function:

PRStatus _PR_MD_GETHOSTNAME ( char *  name,
PRUint32  namelen 
)

Here is the caller graph for this function:

Definition at line 690 of file os2io.c.

{
   /* For once, the VAC compiler/library did a nice thing.
    * The file handle used by the C runtime is the same one
    * returned by the OS when you call DosOpen().  This means
    * that you can take an OS HFILE and use it with C file
    * functions.  The only caveat is that you have to call
    * _setmode() first to initialize some junk.  This is
    * immensely useful because I did not have a clue how to
    * implement this function otherwise.  The windows folks
    * took the source from the Microsoft C library source, but
    * IBM wasn't kind enough to ship the source with VAC.
    * On second thought, the needed function could probably
    * be gotten from the OS/2 GNU library source, but the
    * point is now moot.
    */
   struct stat hinfo;
    PRInt64 s, s2us;

    _setmode(fd->secret->md.osfd, O_BINARY);
    if(fstat((int)fd->secret->md.osfd, &hinfo) != NO_ERROR) {
              _PR_MD_MAP_FSTAT_ERROR(errno);
        return -1;
       }

    if (hinfo.st_mode & S_IFDIR)
        info->type = PR_FILE_DIRECTORY;
    else
        info->type = PR_FILE_FILE;

    info->size = hinfo.st_size;
    LL_I2L(s2us, PR_USEC_PER_SEC);
    LL_I2L(s, hinfo.st_mtime);
    LL_MUL(s, s, s2us);
    info->modifyTime = s;
    LL_I2L(s, hinfo.st_ctime);
    LL_MUL(s, s, s2us);
    info->creationTime = s;

    return 0;
}

Here is the call graph for this function:

Definition at line 733 of file os2io.c.

{
    PRFileInfo info32;
    PRInt32 rv = _PR_MD_GETOPENFILEINFO(fd, &info32);
    if (0 == rv)
    {
       info->type = info32.type;
       LL_UI2L(info->size,info32.size);
    
       info->modifyTime = info32.modifyTime;
       info->creationTime = info32.creationTime;
    }
    
    if (isWSEB)
    {
        APIRET rc ;
        FILESTATUS3L fstatus;

        rc = DosQueryFileInfo(fd->secret->md.osfd, FIL_STANDARDL, &fstatus, sizeof(fstatus));

        if (NO_ERROR != rc)
        {
            _PR_MD_MAP_OPEN_ERROR(rc);
            return -1;
        }

        if (! (fstatus.attrFile & FILE_DIRECTORY))
        {
            info->size = fstatus.cbFile;
        }
    }

    return rv;
}

Here is the call graph for this function:

PRStatus _PR_MD_GETPEERNAME ( PRFileDesc fd,
PRNetAddr addr,
PRUint32 addrlen 
)

Definition at line 625 of file os2sock.c.

{
    PRInt32 rv, err;

    rv = getpeername(fd->secret->md.osfd,
                     (struct sockaddr *) addr, (int *)addrlen);
    if (rv < 0) {
        err = sock_errno();
        _PR_MD_MAP_GETPEERNAME_ERROR(err);
    }
    return rv==0?PR_SUCCESS:PR_FAILURE;
}

Here is the call graph for this function:

PRSize _PR_MD_GetRandomNoise ( void buf,
PRSize  size 
)

Definition at line 52 of file brng.c.

{
    struct timeval tv;
    int n = 0;
    int s;

    GETTIMEOFDAY(&tv);

    if ( size >= 0 ) {
        s = _pr_CopyLowBits((char*)buf+n, size, &tv.tv_usec, sizeof(tv.tv_usec));
        size -= s;
        n += s;
    }
    if ( size >= 0 ) {
        s = _pr_CopyLowBits((char*)buf+n, size, &tv.tv_sec, sizeof(tv.tv_usec));
        size -= s;
        n += s;
    }

    return n;
} /* end _PR_MD_GetRandomNoise() */

Here is the call graph for this function:

PRStatus _PR_MD_GETSOCKNAME ( PRFileDesc fd,
PRNetAddr addr,
PRUint32 addrlen 
)

Definition at line 611 of file os2sock.c.

{
    PRInt32 rv, err;

    rv = getsockname(fd->secret->md.osfd,
                     (struct sockaddr *) addr, (int *)addrlen);
    if (rv < 0) {
        err = sock_errno();
        _PR_MD_MAP_GETSOCKNAME_ERROR(err);
    }
    return rv==0?PR_SUCCESS:PR_FAILURE;
}

Here is the call graph for this function:

PRStatus _PR_MD_GETSOCKOPT ( PRFileDesc fd,
PRInt32  level,
PRInt32  optname,
char *  optval,
PRInt32 optlen 
)

Definition at line 639 of file os2sock.c.

{
    PRInt32 rv, err;

    rv = getsockopt(fd->secret->md.osfd, level, optname, optval, (int *)optlen);
    if (rv < 0) {
        err = sock_errno();
        _PR_MD_MAP_GETSOCKOPT_ERROR(err);
    }
    return rv==0?PR_SUCCESS:PR_FAILURE;
}

Here is the call graph for this function:

PRStatus _PR_MD_GETSYSINFO ( PRSysInfo  cmd,
char *  name,
PRUint32  namelen 
)

Here is the caller graph for this function: