VirtualBox

Ignore:
Timestamp:
Nov 21, 2023 3:00:17 PM (14 months ago)
Author:
vboxsync
Message:

libs/xpcom: Bury the NSPR thread code finally, there is no user left, bugref:10545

Location:
trunk/src/libs/xpcom18a4/nsprpub/pr
Files:
3 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/nsprpub/pr/include/md/_darwin.h

    r101969 r102215  
    3939#define nspr_darwin_defs_h___
    4040
    41 #include "prthread.h"
    42 
    4341#include <sys/syscall.h>
    4442
     
    7068
    7169#undef  HAVE_STACK_GROWING_UP
    72 #define HAVE_DLL
    73 #define USE_MACH_DYLD
    7470#define _PR_HAVE_SOCKADDR_LEN
    7571#define _PR_STAT_HAS_ST_ATIMESPEC
    7672#define _PR_HAVE_LARGE_OFF_T
    7773#define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
    78 
    79 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 /* Mac OS X 10.6 has poll(). */
    80 # if 0 /* ... but we don't use it because it performs worse on Mt. Lion - WEIRD! */
    81 # define _PR_POLL_AVAILABLE     1
    82 # define _PR_USE_POLL           1
    83 # endif
    84 #endif
    85 
    86 #define _PR_INET6
    87 /*
    88  * I'd prefer to use getipnodebyname and getipnodebyaddr but the
    89  * getipnodebyname(3) man page on Mac OS X 10.2 says they are not
    90  * thread-safe.  AI_V4MAPPED|AI_ADDRCONFIG doesn't work either.
    91  */
    92 #define _PR_HAVE_GETHOSTBYNAME2
    93 #define _PR_HAVE_GETADDRINFO
    94 /*
    95  * On Mac OS X 10.2, gethostbyaddr fails with h_errno=NO_RECOVERY
    96  * if you pass an IPv4-mapped IPv6 address to it.
    97  */
    98 #define _PR_GHBA_DISALLOW_V4MAPPED
    99 #ifdef XP_MACOSX
    100 #if !defined(MAC_OS_X_VERSION_10_3) || \
    101     MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_3
    102 /*
    103  * socket(AF_INET6) fails with EPROTONOSUPPORT on Mac OS X 10.1.
    104  * IPv6 under OS X 10.2 and below is not complete (see bug 222031).
    105  */
    106 #define _PR_INET6_PROBE
    107 #endif /* DT < 10.3 */
    108 #if defined(MAC_OS_X_VERSION_10_2) && \
    109     MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2
    110 /* Mac OS X 10.2 has inet_ntop and inet_pton. */
    111 #define _PR_HAVE_INET_NTOP
    112 #endif /* DT >= 10.2 */
    113 #endif /* XP_MACOSX */
    114 #define _PR_IPV6_V6ONLY_PROBE
    115 /* The IPV6_V6ONLY socket option is not defined on Mac OS X 10.1. */
    116 #ifndef IPV6_V6ONLY
    117 #define IPV6_V6ONLY 27
    118 #endif
    119 
    120 #define USE_SETJMP
    121 
    122 #if !defined(_PR_PTHREADS)
    123 
    124 #include <setjmp.h>
    125 
    126 #define PR_CONTEXT_TYPE jmp_buf
    127 
    128 #define CONTEXT(_th)       ((_th)->md.context)
    129 #define _MD_GET_SP(_th)    (((struct sigcontext *) (_th)->md.context)->sc_onstack)
    130 #define PR_NUM_GCREGS       _JBLEN
    131 
    132 /*
    133 ** Initialize a thread context to run "_main()" when started
    134 */
    135 #define _MD_INIT_CONTEXT(_thread, _sp, _main, status)  \
    136 {  \
    137     *status = PR_TRUE;  \
    138     if (setjmp(CONTEXT(_thread))) {  \
    139         _main();  \
    140     }  \
    141     _MD_GET_SP(_thread) = (unsigned char*) ((_sp) - 64); \
    142 }
    143 
    144 #define _MD_SWITCH_CONTEXT(_thread)  \
    145     if (!setjmp(CONTEXT(_thread))) {  \
    146         (_thread)->md.errcode = errno;  \
    147         _PR_Schedule();  \
    148     }
    149 
    150 /*
    151 ** Restore a thread context, saved by _MD_SWITCH_CONTEXT
    152 */
    153 #define _MD_RESTORE_CONTEXT(_thread) \
    154 {   \
    155     errno = (_thread)->md.errcode;  \
    156     _MD_SET_CURRENT_THREAD(_thread);  \
    157     longjmp(CONTEXT(_thread), 1);  \
    158 }
    159 
    160 /* Machine-dependent (MD) data structures */
    161 
    162 struct _MDThread {
    163     PR_CONTEXT_TYPE context;
    164     int id;
    165     int errcode;
    166 };
    167 
    168 struct _MDThreadStack {
    169     PRInt8 notused;
    170 };
    171 
    172 struct _MDLock {
    173     PRInt8 notused;
    174 };
    175 
    176 struct _MDSemaphore {
    177     PRInt8 notused;
    178 };
    179 
    180 struct _MDCVar {
    181     PRInt8 notused;
    182 };
    183 
    184 struct _MDSegment {
    185     PRInt8 notused;
    186 };
    187 
    188 /*
    189  * md-specific cpu structure field
    190  */
    191 #define _PR_MD_MAX_OSFD FD_SETSIZE
    192 
    193 struct _MDCPU_Unix {
    194     PRCList ioQ;
    195     PRUint32 ioq_timeout;
    196     PRInt32 ioq_max_osfd;
    197     PRInt32 ioq_osfd_cnt;
    198 #ifndef _PR_USE_POLL
    199     fd_set fd_read_set, fd_write_set, fd_exception_set;
    200     PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
    201                                 fd_exception_cnt[_PR_MD_MAX_OSFD];
    202 #else
    203         struct pollfd *ioq_pollfds;
    204         int ioq_pollfds_size;
    205 #endif  /* _PR_USE_POLL */
    206 };
    207 
    208 #define _PR_IOQ(_cpu)                   ((_cpu)->md.md_unix.ioQ)
    209 #define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
    210 #define _PR_FD_READ_SET(_cpu)           ((_cpu)->md.md_unix.fd_read_set)
    211 #define _PR_FD_READ_CNT(_cpu)           ((_cpu)->md.md_unix.fd_read_cnt)
    212 #define _PR_FD_WRITE_SET(_cpu)          ((_cpu)->md.md_unix.fd_write_set)
    213 #define _PR_FD_WRITE_CNT(_cpu)          ((_cpu)->md.md_unix.fd_write_cnt)
    214 #define _PR_FD_EXCEPTION_SET(_cpu)      ((_cpu)->md.md_unix.fd_exception_set)
    215 #define _PR_FD_EXCEPTION_CNT(_cpu)      ((_cpu)->md.md_unix.fd_exception_cnt)
    216 #define _PR_IOQ_TIMEOUT(_cpu)           ((_cpu)->md.md_unix.ioq_timeout)
    217 #define _PR_IOQ_MAX_OSFD(_cpu)          ((_cpu)->md.md_unix.ioq_max_osfd)
    218 #define _PR_IOQ_OSFD_CNT(_cpu)          ((_cpu)->md.md_unix.ioq_osfd_cnt)
    219 #define _PR_IOQ_POLLFDS(_cpu)           ((_cpu)->md.md_unix.ioq_pollfds)
    220 #define _PR_IOQ_POLLFDS_SIZE(_cpu)      ((_cpu)->md.md_unix.ioq_pollfds_size)
    221 
    222 #define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu)  32
    223 
    224 struct _MDCPU {
    225         struct _MDCPU_Unix md_unix;
    226 };
    227 
    228 #define _MD_INIT_LOCKS()
    229 #define _MD_NEW_LOCK(lock) PR_SUCCESS
    230 #define _MD_FREE_LOCK(lock)
    231 #define _MD_LOCK(lock)
    232 #define _MD_UNLOCK(lock)
    233 #define _MD_INIT_IO()
    234 #define _MD_IOQ_LOCK()
    235 #define _MD_IOQ_UNLOCK()
    236 
    237 extern PRStatus _MD_InitializeThread(PRThread *thread);
    238 
    239 #define _MD_INIT_RUNNING_CPU(cpu)       _MD_unix_init_running_cpu(cpu)
    240 #define _MD_INIT_THREAD                 _MD_InitializeThread
    241 #define _MD_EXIT_THREAD(thread)
    242 #define _MD_SUSPEND_THREAD(thread)      _MD_suspend_thread
    243 #define _MD_RESUME_THREAD(thread)       _MD_resume_thread
    244 #define _MD_CLEAN_THREAD(_thread)
    245 
    246 extern PRStatus _MD_CREATE_THREAD(
    247     PRThread *thread,
    248     void (*start) (void *),
    249     PRThreadPriority priority,
    250     PRThreadScope scope,
    251     PRThreadState state,
    252     PRUint32 stackSize);
    253 extern void _MD_SET_PRIORITY(struct _MDThread *thread, PRUintn newPri);
    254 extern PRStatus _MD_WAIT(PRThread *, PRIntervalTime timeout);
    255 extern PRStatus _MD_WAKEUP_WAITER(PRThread *);
    256 extern void _MD_YIELD(void);
    257 
    258 #endif /* ! _PR_PTHREADS */
    25974
    26075#define _MD_EARLY_INIT          _MD_EarlyInit
     
    26782extern PRIntervalTime   _PR_UNIX_TicksPerSecond(void);
    26883
    269 /*
    270  * We wrapped the select() call.  _MD_SELECT refers to the built-in,
    271  * unwrapped version.
    272  */
    273 #define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv)
    274 
    275 /* For writev() */
    276 #include <sys/uio.h>
    277 
    27884#endif /* nspr_darwin_defs_h___ */
  • trunk/src/libs/xpcom18a4/nsprpub/pr/include/md/_linux.h

    r101969 r102215  
    3838#ifndef nspr_linux_defs_h___
    3939#define nspr_linux_defs_h___
    40 
    41 #include "prthread.h"
    4240
    4341/*
     
    8381#undef  HAVE_STACK_GROWING_UP
    8482
    85 /*
    86  * Elf linux supports dl* functions
    87  */
    88 #define HAVE_DLL
    89 #define USE_DLFCN
    90 
    91 #define USE_SETJMP
    92 #if defined(__GLIBC__) && __GLIBC__ >= 2
    93 #define _PR_POLL_AVAILABLE
    94 #endif
    95 #undef _PR_USE_POLL
    96 #define _PR_STAT_HAS_ONLY_ST_ATIME
    97 #if defined(__alpha) || defined(__ia64__)
    98 #define _PR_HAVE_LARGE_OFF_T
    99 #elif (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1)
    100 #define _PR_HAVE_OFF64_T
    101 #else
    102 #define _PR_NO_LARGE_FILES
    103 #endif
    104 #if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1)
    105 #define _PR_INET6
    106 #define _PR_HAVE_INET_NTOP
    107 #define _PR_HAVE_GETHOSTBYNAME2
    108 #define _PR_HAVE_GETADDRINFO
    109 #define _PR_INET6_PROBE
    110 #endif
    111 #define _PR_HAVE_SYSV_SEMAPHORES
    112 #define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
    113 #if (__GLIBC__ >= 2) && defined(_PR_PTHREADS)
    114 #define _PR_HAVE_GETHOST_R
    115 #define _PR_HAVE_GETHOST_R_INT
    116 #endif
    117 
    118 #ifdef _PR_PTHREADS
    119 
    12083extern void _MD_CleanupBeforeExit(void);
    12184#define _MD_CLEANUP_BEFORE_EXIT _MD_CleanupBeforeExit
    122 
    123 #else  /* ! _PR_PTHREADS */
    124 
    125 #include <setjmp.h>
    126 
    127 #define PR_CONTEXT_TYPE sigjmp_buf
    128 
    129 #define CONTEXT(_th) ((_th)->md.context)
    130 
    131 #ifdef __powerpc__
    132 /*
    133  * PowerPC based MkLinux
    134  *
    135  * On the PowerPC, the new style jmp_buf isn't used until glibc
    136  * 2.1.
    137  */
    138 #if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1)
    139 #define _MD_GET_SP(_t) (_t)->md.context[0].__jmpbuf[JB_GPR1]
    140 #else
    141 #define _MD_GET_SP(_t) (_t)->md.context[0].__jmpbuf[0].__misc[0]
    142 #endif /* glibc 2.1 or later */
    143 #define _MD_SET_FP(_t, val)
    144 #define _MD_GET_SP_PTR(_t) &(_MD_GET_SP(_t))
    145 #define _MD_GET_FP_PTR(_t) ((void *) 0)
    146 /* aix = 64, macos = 70 */
    147 #define PR_NUM_GCREGS  64
    148 
    149 #elif defined(__alpha)
    150 /* Alpha based Linux */
    151 
    152 #if defined(__GLIBC__) && __GLIBC__ >= 2
    153 #define _MD_GET_SP(_t) (_t)->md.context[0].__jmpbuf[JB_SP]
    154 #define _MD_SET_FP(_t, val)
    155 #define _MD_GET_SP_PTR(_t) &(_MD_GET_SP(_t))
    156 #define _MD_GET_FP_PTR(_t) ((void *) 0)
    157 #define _MD_SP_TYPE long int
    158 #else
    159 #define _MD_GET_SP(_t) (_t)->md.context[0].__jmpbuf[0].__sp
    160 #define _MD_SET_FP(_t, val)
    161 #define _MD_GET_SP_PTR(_t) &(_MD_GET_SP(_t))
    162 #define _MD_GET_FP_PTR(_t) ((void *) 0)
    163 #define _MD_SP_TYPE __ptr_t
    164 #endif /* defined(__GLIBC__) && __GLIBC__ >= 2 */
    165 
    166 /* XXX not sure if this is correct, or maybe it should be 17? */
    167 #define PR_NUM_GCREGS 9
    168 
    169 #elif defined(__ia64__)
    170 
    171 #define _MD_GET_SP(_t)      ((long *)((_t)->md.context[0].__jmpbuf)[0])
    172 #define _MD_SET_FP(_t, val)
    173 #define _MD_GET_SP_PTR(_t)  &(_MD_GET_SP(_t))
    174 #define _MD_GET_FP_PTR(_t)  ((void *) 0)
    175 #define _MD_SP_TYPE         long int
    176 
    177 #define PR_NUM_GCREGS       _JBLEN
    178 
    179 #elif defined(__mc68000__)
    180 /* m68k based Linux */
    181 
    182 /*
    183  * On the m68k, glibc still uses the old style sigjmp_buf, even
    184  * in glibc 2.0.7.
    185  */
    186 #if defined(__GLIBC__) && __GLIBC__ >= 2
    187 #define _MD_GET_SP(_t) (_t)->md.context[0].__jmpbuf[0].__sp
    188 #define _MD_SET_FP(_t, val)
    189 #define _MD_GET_SP_PTR(_t) &(_MD_GET_SP(_t))
    190 #define _MD_GET_FP_PTR(_t) ((void *) 0)
    191 #define _MD_SP_TYPE int
    192 #else
    193 #define _MD_GET_SP(_t) (_t)->md.context[0].__jmpbuf[0].__sp
    194 #define _MD_SET_FP(_t, val)
    195 #define _MD_GET_SP_PTR(_t) &(_MD_GET_SP(_t))
    196 #define _MD_GET_FP_PTR(_t) ((void *) 0)
    197 #define _MD_SP_TYPE __ptr_t
    198 #endif /* defined(__GLIBC__) && __GLIBC__ >= 2 */
    199 
    200 /* XXX not sure if this is correct, or maybe it should be 17? */
    201 #define PR_NUM_GCREGS 9
    202 
    203 #elif defined(__sparc__)
    204 /* Sparc */
    205 #if defined(__GLIBC__) && __GLIBC__ >= 2
    206 /*
    207  * You need glibc2-2.0.7-25 or later. The libraries that came with
    208  * Red Hat 5.1 are not new enough, but they are in 5.2.
    209  */
    210 #define _MD_GET_SP(_t) (_t)->md.context[0].__jmpbuf[JB_SP]
    211 #define _MD_SET_FP(_t, val) ((_t)->md.context[0].__jmpbuf[JB_FP] = val)
    212 #define _MD_GET_SP_PTR(_t) &(_MD_GET_SP(_t))
    213 #define _MD_GET_FP_PTR(_t) (&(_t)->md.context[0].__jmpbuf[JB_FP])
    214 #define _MD_SP_TYPE int
    215 #else
    216 #define _MD_GET_SP(_t) (_t)->md.context[0].__jmpbuf[0].__fp
    217 #define _MD_SET_FP(_t, val)
    218 #define _MD_GET_SP_PTR(_t) &(_MD_GET_SP(_t))
    219 #define _MD_GET_FP_PTR(_t) ((void *) 0)
    220 #define _MD_SP_TYPE __ptr_t
    221 #endif /* defined(__GLIBC__) && __GLIBC__ >= 2 */
    222 
    223 #elif defined(__i386__)
    224 /* Intel based Linux */
    225 #if defined(__GLIBC__) && __GLIBC__ >= 2
    226 #define _MD_GET_SP(_t) (_t)->md.context[0].__jmpbuf[JB_SP]
    227 #define _MD_SET_FP(_t, val) ((_t)->md.context[0].__jmpbuf[JB_BP] = val)
    228 #define _MD_GET_SP_PTR(_t) &(_MD_GET_SP(_t))
    229 #define _MD_GET_FP_PTR(_t) (&(_t)->md.context[0].__jmpbuf[JB_BP])
    230 #define _MD_SP_TYPE int
    231 #else
    232 #define _MD_GET_SP(_t) (_t)->md.context[0].__jmpbuf[0].__sp
    233 #define _MD_SET_FP(_t, val) ((_t)->md.context[0].__jmpbuf[0].__bp = val)
    234 #define _MD_GET_SP_PTR(_t) &(_MD_GET_SP(_t))
    235 #define _MD_GET_FP_PTR(_t) &((_t)->md.context[0].__jmpbuf[0].__bp)
    236 #define _MD_SP_TYPE __ptr_t
    237 #endif /* defined(__GLIBC__) && __GLIBC__ >= 2 */
    238 #define PR_NUM_GCREGS   6
    239 
    240 #elif defined(__mips__)
    241 /* Linux/MIPS */
    242 #if defined(__GLIBC__) && __GLIBC__ >= 2
    243 #define _MD_GET_SP(_t) (_t)->md.context[0].__jmpbuf[0].__sp
    244 #define _MD_SET_FP(_t, val) ((_t)->md.context[0].__jmpbuf[0].__fp = (val))
    245 #define _MD_GET_SP_PTR(_t) &(_MD_GET_SP(_t))
    246 #define _MD_GET_FP_PTR(_t) (&(_t)->md.context[0].__jmpbuf[0].__fp)
    247 #define _MD_SP_TYPE __ptr_t
    248 #else
    249 #error "Linux/MIPS pre-glibc2 not supported yet"
    250 #endif /* defined(__GLIBC__) && __GLIBC__ >= 2 */
    251 
    252 #elif defined(__arm__)
    253 /* ARM/Linux */
    254 #if defined(__GLIBC__) && __GLIBC__ >= 2
    255 #define _MD_GET_SP(_t) (_t)->md.context[0].__jmpbuf[20]
    256 #define _MD_SET_FP(_t, val) ((_t)->md.context[0].__jmpbuf[19] = (val))
    257 #define _MD_GET_SP_PTR(_t) &(_MD_GET_SP(_t))
    258 #define _MD_GET_FP_PTR(_t) (&(_t)->md.context[0].__jmpbuf[19])
    259 #define _MD_SP_TYPE __ptr_t
    260 #else
    261 #error "ARM/Linux pre-glibc2 not supported yet"
    262 #endif /* defined(__GLIBC__) && __GLIBC__ >= 2 */
    263 
    264 #else
    265 
    266 #error "Unknown CPU architecture"
    267 
    268 #endif /*__powerpc__*/
    269 
    270 /*
    271 ** Initialize a thread context to run "_main()" when started
    272 */
    273 #ifdef __powerpc__
    274 
    275 #define _MD_INIT_CONTEXT(_thread, _sp, _main, status)  \
    276 {  \
    277     *status = PR_TRUE;  \
    278     if (sigsetjmp(CONTEXT(_thread), 1)) {  \
    279         _main();  \
    280     }  \
    281     _MD_GET_SP(_thread) = (unsigned char*) ((_sp) - 128); \
    282         _thread->md.sp = _MD_GET_SP_PTR(_thread); \
    283         _thread->md.fp = _MD_GET_FP_PTR(_thread); \
    284     _MD_SET_FP(_thread, 0); \
    285 }
    286 
    287 #elif defined(__mips__)
    288 
    289 #define _MD_INIT_CONTEXT(_thread, _sp, _main, status)  \
    290 {  \
    291     *status = PR_TRUE;  \
    292     (void) sigsetjmp(CONTEXT(_thread), 1);  \
    293     _thread->md.context[0].__jmpbuf[0].__pc = (__ptr_t) _main;  \
    294     _MD_GET_SP(_thread) = (_MD_SP_TYPE) ((_sp) - 64); \
    295     _thread->md.sp = _MD_GET_SP_PTR(_thread); \
    296     _thread->md.fp = _MD_GET_FP_PTR(_thread); \
    297     _MD_SET_FP(_thread, 0); \
    298 }
    299 
    300 #else
    301 
    302 #define _MD_INIT_CONTEXT(_thread, _sp, _main, status)  \
    303 {  \
    304     *status = PR_TRUE;  \
    305     if (sigsetjmp(CONTEXT(_thread), 1)) {  \
    306         _main();  \
    307     }  \
    308     _MD_GET_SP(_thread) = (_MD_SP_TYPE) ((_sp) - 64); \
    309         _thread->md.sp = _MD_GET_SP_PTR(_thread); \
    310         _thread->md.fp = _MD_GET_FP_PTR(_thread); \
    311     _MD_SET_FP(_thread, 0); \
    312 }
    313 
    314 #endif /*__powerpc__*/
    315 
    316 #define _MD_SWITCH_CONTEXT(_thread)  \
    317     if (!sigsetjmp(CONTEXT(_thread), 1)) {  \
    318         (_thread)->md.errcode = errno;  \
    319         _PR_Schedule();  \
    320     }
    321 
    322 /*
    323 ** Restore a thread context, saved by _MD_SWITCH_CONTEXT
    324 */
    325 #define _MD_RESTORE_CONTEXT(_thread) \
    326 {   \
    327     errno = (_thread)->md.errcode;  \
    328     _MD_SET_CURRENT_THREAD(_thread);  \
    329     siglongjmp(CONTEXT(_thread), 1);  \
    330 }
    331 
    332 /* Machine-dependent (MD) data structures */
    333 
    334 struct _MDThread {
    335     PR_CONTEXT_TYPE context;
    336         void *sp;
    337         void *fp;
    338     int id;
    339     int errcode;
    340 };
    341 
    342 struct _MDThreadStack {
    343     PRInt8 notused;
    344 };
    345 
    346 struct _MDLock {
    347     PRInt8 notused;
    348 };
    349 
    350 struct _MDSemaphore {
    351     PRInt8 notused;
    352 };
    353 
    354 struct _MDCVar {
    355     PRInt8 notused;
    356 };
    357 
    358 struct _MDSegment {
    359     PRInt8 notused;
    360 };
    361 
    362 /*
    363  * md-specific cpu structure field
    364  */
    365 #include <sys/time.h>  /* for FD_SETSIZE */
    366 #define _PR_MD_MAX_OSFD FD_SETSIZE
    367 
    368 struct _MDCPU_Unix {
    369     PRCList ioQ;
    370     PRUint32 ioq_timeout;
    371     PRInt32 ioq_max_osfd;
    372     PRInt32 ioq_osfd_cnt;
    373 #ifndef _PR_USE_POLL
    374     fd_set fd_read_set, fd_write_set, fd_exception_set;
    375     PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
    376                                 fd_exception_cnt[_PR_MD_MAX_OSFD];
    377 #else
    378         struct pollfd *ioq_pollfds;
    379         int ioq_pollfds_size;
    380 #endif  /* _PR_USE_POLL */
    381 };
    382 
    383 #define _PR_IOQ(_cpu)                   ((_cpu)->md.md_unix.ioQ)
    384 #define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
    385 #define _PR_FD_READ_SET(_cpu)           ((_cpu)->md.md_unix.fd_read_set)
    386 #define _PR_FD_READ_CNT(_cpu)           ((_cpu)->md.md_unix.fd_read_cnt)
    387 #define _PR_FD_WRITE_SET(_cpu)          ((_cpu)->md.md_unix.fd_write_set)
    388 #define _PR_FD_WRITE_CNT(_cpu)          ((_cpu)->md.md_unix.fd_write_cnt)
    389 #define _PR_FD_EXCEPTION_SET(_cpu)      ((_cpu)->md.md_unix.fd_exception_set)
    390 #define _PR_FD_EXCEPTION_CNT(_cpu)      ((_cpu)->md.md_unix.fd_exception_cnt)
    391 #define _PR_IOQ_TIMEOUT(_cpu)           ((_cpu)->md.md_unix.ioq_timeout)
    392 #define _PR_IOQ_MAX_OSFD(_cpu)          ((_cpu)->md.md_unix.ioq_max_osfd)
    393 #define _PR_IOQ_OSFD_CNT(_cpu)          ((_cpu)->md.md_unix.ioq_osfd_cnt)
    394 #define _PR_IOQ_POLLFDS(_cpu)           ((_cpu)->md.md_unix.ioq_pollfds)
    395 #define _PR_IOQ_POLLFDS_SIZE(_cpu)      ((_cpu)->md.md_unix.ioq_pollfds_size)
    396 
    397 #define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu)  32
    398 
    399 struct _MDCPU {
    400         struct _MDCPU_Unix md_unix;
    401 };
    402 
    403 #define _MD_INIT_LOCKS()
    404 #define _MD_NEW_LOCK(lock) PR_SUCCESS
    405 #define _MD_FREE_LOCK(lock)
    406 #define _MD_LOCK(lock)
    407 #define _MD_UNLOCK(lock)
    408 #define _MD_INIT_IO()
    409 #define _MD_IOQ_LOCK()
    410 #define _MD_IOQ_UNLOCK()
    411 
    412 extern PRStatus _MD_InitializeThread(PRThread *thread);
    413 
    414 #define _MD_INIT_RUNNING_CPU(cpu)       _MD_unix_init_running_cpu(cpu)
    415 #define _MD_INIT_THREAD                 _MD_InitializeThread
    416 #define _MD_EXIT_THREAD(thread)
    417 #define _MD_SUSPEND_THREAD(thread)      _MD_suspend_thread
    418 #define _MD_RESUME_THREAD(thread)       _MD_resume_thread
    419 #define _MD_CLEAN_THREAD(_thread)
    420 
    421 extern PRStatus _MD_CREATE_THREAD(
    422     PRThread *thread,
    423     void (*start) (void *),
    424     PRThreadPriority priority,
    425     PRThreadScope scope,
    426     PRThreadState state,
    427     PRUint32 stackSize);
    428 extern void _MD_SET_PRIORITY(struct _MDThread *thread, PRUintn newPri);
    429 extern PRStatus _MD_WAIT(PRThread *, PRIntervalTime timeout);
    430 extern PRStatus _MD_WAKEUP_WAITER(PRThread *);
    431 extern void _MD_YIELD(void);
    432 
    433 #endif /* ! _PR_PTHREADS */
    43485
    43586extern void _MD_EarlyInit(void);
     
    44293#define _MD_INTERVAL_PER_SEC            _PR_UNIX_TicksPerSecond
    44394
    444 /*
    445  * We wrapped the select() call.  _MD_SELECT refers to the built-in,
    446  * unwrapped version.
    447  */
    448 #define _MD_SELECT __select
    449 
    450 #ifdef _PR_POLL_AVAILABLE
    451 #include <sys/poll.h>
    452 extern int __syscall_poll(struct pollfd *ufds, unsigned long int nfds,
    453         int timeout);
    454 #define _MD_POLL __syscall_poll
    455 #endif
    456 
    457 /* For writev() */
    458 #include <sys/uio.h>
    459 
    460 extern void _MD_linux_map_sendfile_error(int err);
    461 
    46295#endif /* nspr_linux_defs_h___ */
    46396
  • trunk/src/libs/xpcom18a4/nsprpub/pr/include/md/_pth.h

    r5589 r102215  
    4747#define _PR_MD_ENABLE_CLOCK_INTERRUPTS()
    4848
    49 /* In good standards fashion, the DCE threads (based on posix-4) are not
    50  * quite the same as newer posix implementations.  These are mostly name
    51  * changes and small differences, so macros usually do the trick
    52  */
    53 #ifdef _PR_DCETHREADS
    54 #define _PT_PTHREAD_MUTEXATTR_INIT        pthread_mutexattr_create
    55 #define _PT_PTHREAD_MUTEXATTR_DESTROY     pthread_mutexattr_delete
    56 #define _PT_PTHREAD_MUTEX_INIT(m, a)      pthread_mutex_init(&(m), a)
    57 #define _PT_PTHREAD_MUTEX_IS_LOCKED(m)    (0 == pthread_mutex_trylock(&(m)))
    58 #define _PT_PTHREAD_CONDATTR_INIT         pthread_condattr_create
    59 #define _PT_PTHREAD_COND_INIT(m, a)       pthread_cond_init(&(m), a)
    60 #define _PT_PTHREAD_CONDATTR_DESTROY      pthread_condattr_delete
    61 
    62 /* Notes about differences between DCE threads and pthreads 10:
    63  *   1. pthread_mutex_trylock returns 1 when it locks the mutex
    64  *      0 when it does not.  The latest pthreads has a set of errno-like
    65  *      return values.
    66  *   2. return values from pthread_cond_timedwait are different.
    67  *
    68  *
    69  *
    70  */
    71 #elif defined(BSDI)
    72 /*
    73  * Mutex and condition attributes are not supported.  The attr
    74  * argument to pthread_mutex_init() and pthread_cond_init() must
    75  * be passed as NULL.
    76  *
    77  * The memset calls in _PT_PTHREAD_MUTEX_INIT and _PT_PTHREAD_COND_INIT
    78  * are to work around BSDI's using a single bit to indicate a mutex
    79  * or condition variable is initialized.  This entire BSDI section
    80  * will go away when BSDI releases updated threads libraries for
    81  * BSD/OS 3.1 and 4.0.
    82  */
    83 #define _PT_PTHREAD_MUTEXATTR_INIT(x)     0
    84 #define _PT_PTHREAD_MUTEXATTR_DESTROY(x)  /* */
    85 #define _PT_PTHREAD_MUTEX_INIT(m, a)      (memset(&(m), 0, sizeof(m)), \
    86                                       pthread_mutex_init(&(m), NULL))
    87 #define _PT_PTHREAD_MUTEX_IS_LOCKED(m)    (EBUSY == pthread_mutex_trylock(&(m)))
    88 #define _PT_PTHREAD_CONDATTR_INIT(x)      0
    89 #define _PT_PTHREAD_CONDATTR_DESTROY(x)   /* */
    90 #define _PT_PTHREAD_COND_INIT(m, a)       (memset(&(m), 0, sizeof(m)), \
    91                                       pthread_cond_init(&(m), NULL))
    92 #else
    9349#define _PT_PTHREAD_MUTEXATTR_INIT        pthread_mutexattr_init
    9450#define _PT_PTHREAD_MUTEXATTR_DESTROY     pthread_mutexattr_destroy
     
    10258#define _PT_PTHREAD_CONDATTR_DESTROY      pthread_condattr_destroy
    10359#define _PT_PTHREAD_COND_INIT(m, a)       pthread_cond_init(&(m), &(a))
    104 #endif
    10560
    10661/* The pthreads standard does not specify an invalid value for the
     
    13388 *   recursion ensues.
    13489 */
    135 #if defined(_PR_DCETHREADS)
    136 #define _PT_PTHREAD_INVALIDATE_THR_HANDLE(t) \
    137         memset(&(t), 0, sizeof(pthread_t))
    138 #define _PT_PTHREAD_THR_HANDLE_IS_INVALID(t) \
    139         (!memcmp(&(t), &pt_zero_tid, sizeof(pthread_t)))
    140 #define _PT_PTHREAD_COPY_THR_HANDLE(st, dt)   (dt) = (st)
    141 #elif defined(IRIX) || defined(OSF1) || defined(AIX) || defined(SOLARIS) \
     90#if defined(IRIX) || defined(OSF1) || defined(AIX) || defined(SOLARIS) \
    14291        || defined(HPUX) || defined(LINUX) || defined(FREEBSD) \
    14392        || defined(NETBSD) || defined(OPENBSD) || defined(BSDI) \
     
    151100#endif
    152101
    153 #if defined(_PR_DCETHREADS)
    154 #define _PT_PTHREAD_ATTR_INIT            pthread_attr_create
    155 #define _PT_PTHREAD_ATTR_DESTROY         pthread_attr_delete
    156 #define _PT_PTHREAD_CREATE(t, a, f, r)   pthread_create(t, a, f, r)
    157 #define _PT_PTHREAD_KEY_CREATE           pthread_keycreate
    158 #define _PT_PTHREAD_ATTR_SETSCHEDPOLICY  pthread_attr_setsched
    159 #define _PT_PTHREAD_ATTR_GETSTACKSIZE(a, s) \
    160                                      (*(s) = pthread_attr_getstacksize(*(a)), 0)
    161 #define _PT_PTHREAD_GETSPECIFIC(k, r) \
    162                 pthread_getspecific((k), (pthread_addr_t *) &(r))
    163 #elif defined(_PR_PTHREADS)
     102#if defined(_PR_PTHREADS)
    164103#define _PT_PTHREAD_ATTR_INIT            pthread_attr_init
    165104#define _PT_PTHREAD_ATTR_DESTROY         pthread_attr_destroy
     
    173112#endif
    174113
    175 #if defined(_PR_DCETHREADS)
    176 #define _PT_PTHREAD_EXPLICIT_SCHED      _PT_PTHREAD_DEFAULT_SCHED
    177 #endif
    178 
    179 /*
    180  * pthread_mutex_trylock returns different values in DCE threads and
    181  * pthreads.
    182  */
    183 #if defined(_PR_DCETHREADS)
    184 #define PT_TRYLOCK_SUCCESS 1
    185 #define PT_TRYLOCK_BUSY    0
    186 #else
    187114#define PT_TRYLOCK_SUCCESS 0
    188115#define PT_TRYLOCK_BUSY    EBUSY
    189 #endif
    190116
    191117/*
     
    206132#endif
    207133
    208 #if defined(OSF1) || defined(VMS)
    209 #define PT_PRIO_MIN            PRI_OTHER_MIN
    210 #define PT_PRIO_MAX            PRI_OTHER_MAX
    211 #elif defined(IRIX)
    212 #include <sys/sched.h>
    213 #define PT_PRIO_MIN            PX_PRIO_MIN
    214 #define PT_PRIO_MAX            PX_PRIO_MAX
    215 #elif defined(AIX)
    216 #include <sys/priv.h>
    217 #include <sys/sched.h>
    218 #ifndef PTHREAD_CREATE_JOINABLE
    219 #define PTHREAD_CREATE_JOINABLE     PTHREAD_CREATE_UNDETACHED
    220 #endif
    221 #define PT_PRIO_MIN            DEFAULT_PRIO
    222 #define PT_PRIO_MAX            DEFAULT_PRIO
    223 #elif defined(HPUX)
    224 
    225 #if defined(_PR_DCETHREADS)
    226 #define PT_PRIO_MIN            PRI_OTHER_MIN
    227 #define PT_PRIO_MAX            PRI_OTHER_MAX
    228 #else /* defined(_PR_DCETHREADS) */
    229 #include <sys/sched.h>
     134#if defined(LINUX) || defined(FREEBSD)
    230135#define PT_PRIO_MIN            sched_get_priority_min(SCHED_OTHER)
    231136#define PT_PRIO_MAX            sched_get_priority_max(SCHED_OTHER)
    232 #endif /* defined(_PR_DCETHREADS) */
    233 
    234 #elif defined(LINUX) || defined(FREEBSD)
    235 #define PT_PRIO_MIN            sched_get_priority_min(SCHED_OTHER)
    236 #define PT_PRIO_MAX            sched_get_priority_max(SCHED_OTHER)
    237 #elif defined(NTO)
    238 /*
    239  * Neutrino has functions that return the priority range but
    240  * they return invalid numbers, so I just hard coded these here
    241  * for now.  [email protected]
    242  */
    243 #define PT_PRIO_MIN            0
    244 #define PT_PRIO_MAX            30
    245137#elif defined(SOLARIS)
    246138/*
     
    268160 * implementation.
    269161 */
    270 #if defined(_PR_DCETHREADS)
    271 #define _PT_PTHREAD_YIELD()             pthread_yield()
    272 #elif defined(OSF1) || defined(VMS)
    273 /*
    274  * sched_yield can't be called from a signal handler.  Must use
    275  * the _np version.
    276  */
    277 #define _PT_PTHREAD_YIELD()             pthread_yield_np()
    278 #elif defined(AIX)
    279 extern int (*_PT_aix_yield_fcn)();
    280 #define _PT_PTHREAD_YIELD()                     (*_PT_aix_yield_fcn)()
    281 #elif defined(IRIX)
    282 #include <time.h>
    283 #define _PT_PTHREAD_YIELD() \
    284     PR_BEGIN_MACRO                                              \
    285                 struct timespec onemillisec = {0};              \
    286                 onemillisec.tv_nsec = 1000000L;                 \
    287         nanosleep(&onemillisec,NULL);                   \
    288     PR_END_MACRO
    289 #elif defined(HPUX) || defined(LINUX) || defined(SOLARIS) \
     162#if defined(HPUX) || defined(LINUX) || defined(SOLARIS) \
    290163        || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
    291164        || defined(BSDI) || defined(NTO) || defined(DARWIN) \
  • trunk/src/libs/xpcom18a4/nsprpub/pr/include/nspr.h

    r102211 r102215  
    4848#include "prmon.h"
    4949#include "prprf.h"
    50 #include "prthread.h"
    5150#include "prtime.h"
    5251#include "prtypes.h"
  • trunk/src/libs/xpcom18a4/nsprpub/pr/include/private/primpl.h

    r102213 r102215  
    5252#include "prpriv.h"
    5353
    54 typedef struct PRSegment PRSegment;
    55 
    5654#include "md/prosdep.h"
    57 
    58 #ifdef _PR_HAVE_POSIX_SEMAPHORES
    59 #include <semaphore.h>
    60 #elif defined(_PR_HAVE_SYSV_SEMAPHORES)
    61 #include <sys/sem.h>
    62 #endif
    63 
    64 /*************************************************************************
    65 *****  A Word about Model Dependent Function Naming Convention ***********
    66 *************************************************************************/
    67 
    68 /*
    69 NSPR 2.0 must implement its function across a range of platforms
    70 including: MAC, Windows/16, Windows/95, Windows/NT, and several
    71 variants of Unix. Each implementation shares common code as well
    72 as having platform dependent portions. This standard describes how
    73 the model dependent portions are to be implemented.
    74 
    75 In header file pr/include/primpl.h, each publicly declared
    76 platform dependent function is declared as:
    77 
    78 NSPR_API void _PR_MD_FUNCTION( long arg1, long arg2 );
    79 #define _PR_MD_FUNCTION _MD_FUNCTION
    80 
    81 In header file pr/include/md/<platform>/_<platform>.h,
    82 each #define'd macro is redefined as one of:
    83 
    84 #define _MD_FUNCTION <blanks>
    85 #define _MD_FUNCTION <expanded macro>
    86 #define _MD_FUNCTION <osFunction>
    87 #define _MD_FUNCTION <_MD_Function>
    88 
    89 Where:
    90 
    91 <blanks> is no definition at all. In this case, the function is not implemented
    92 and is never called for this platform.
    93 For example:
    94 #define _MD_INIT_CPUS()
    95 
    96 <expanded macro> is a C language macro expansion.
    97 For example:
    98 #define        _MD_CLEAN_THREAD(_thread) \
    99     PR_BEGIN_MACRO \
    100         PR_DestroyCondVar(_thread->md.asyncIOCVar); \
    101         PR_DestroyLock(_thread->md.asyncIOLock); \
    102     PR_END_MACRO
    103 
    104 <osFunction> is some function implemented by the host operating system.
    105 For example:
    106 #define _MD_EXIT        exit
    107 
    108 <_MD_function> is the name of a function implemented for this platform in
    109 pr/src/md/<platform>/<soruce>.c file.
    110 For example:
    111 #define        _MD_GETFILEINFO         _MD_GetFileInfo
    112 
    113 In <source>.c, the implementation is:
    114 PR_IMPLEMENT(PRInt32) _MD_GetFileInfo(const char *fn, PRFileInfo *info);
    115 */
    11655
    11756PR_BEGIN_EXTERN_C
     
    11958typedef struct _MDLock _MDLock;
    12059typedef struct _MDCVar _MDCVar;
    121 typedef struct _MDSegment _MDSegment;
    122 typedef struct _MDThread _MDThread;
    123 typedef struct _MDThreadStack _MDThreadStack;
    124 typedef struct _MDSemaphore _MDSemaphore;
    125 typedef struct _MDDir _MDDir;
    126 typedef struct _MDFileDesc _MDFileDesc;
    127 typedef struct _MDProcess _MDProcess;
    128 typedef struct _MDFileMap _MDFileMap;
    12960
    13061/*
     
    14778};
    14879
    149 /*
    150  * bits defined for pthreads 'state' field
    151  */
    152 #define PT_THREAD_DETACHED  0x01    /* thread can't be joined */
    153 #define PT_THREAD_GLOBAL    0x02    /* a global thread (unlikely) */
    154 #define PT_THREAD_SYSTEM    0x04    /* system (not user) thread */
    155 #define PT_THREAD_PRIMORD   0x08    /* this is the primordial thread */
    156 #define PT_THREAD_ABORTED   0x10    /* thread has been interrupted */
    157 #define PT_THREAD_GCABLE    0x20    /* thread is garbage collectible */
    158 #define PT_THREAD_SUSPENDED 0x40    /* thread has been suspended */
    159 #define PT_THREAD_FOREIGN   0x80    /* thread is not one of ours */
    160 #define PT_THREAD_BOUND     0x100    /* a bound-global thread */
    161 
    162 #define _PT_THREAD_INTERRUPTED(thr)                                     \
    163                 (!(thr->interrupt_blocked) && (thr->state & PT_THREAD_ABORTED))
    164 #define _PT_THREAD_BLOCK_INTERRUPT(thr)                         \
    165                 (thr->interrupt_blocked = 1)
    166 #define _PT_THREAD_UNBLOCK_INTERRUPT(thr)                       \
    167                 (thr->interrupt_blocked = 0)
    168 
    169 #define _PT_IS_GCABLE_THREAD(thr) ((thr)->state & PT_THREAD_GCABLE)
    170 
    171 /*
    172 ** Possible values for thread's suspend field
    173 ** Note that the first two can be the same as they are really mutually exclusive,
    174 ** i.e. both cannot be happening at the same time. We have two symbolic names
    175 ** just as a mnemonic.
    176 **/
    177 #define PT_THREAD_RESUMED   0x80    /* thread has been resumed */
    178 #define PT_THREAD_SETGCABLE 0x100   /* set the GCAble flag */
    179 
    18080/************************************************************************/
    18181/*************************************************************************
     
    18484*************************************************************************/
    18585/************************************************************************/
    186 
    187 extern void _PR_InitThreads(
    188     PRThreadType type, PRThreadPriority priority, PRUintn maxPTDs);
    18986
    19087struct PRLock {
     
    215112/************************************************************************/
    216113
    217 struct PRSemaphore {
    218     PRCondVar *cvar;        /* associated lock and condition variable queue */
    219     PRUintn count;            /* the value of the counting semaphore */
    220     PRUint32 waiters;            /* threads waiting on the semaphore */
    221 };
    222 
    223 NSPR_API(void) _PR_InitSem(void);
    224 
    225 /*************************************************************************/
    226 
    227 struct PRSem {
    228 #ifdef _PR_HAVE_POSIX_SEMAPHORES
    229     sem_t *sem;
    230 #elif defined(_PR_HAVE_SYSV_SEMAPHORES)
    231     int semid;
    232 #elif defined(WIN32)
    233     HANDLE sem;
    234 #else
    235     PRInt8 notused;
    236 #endif
    237 };
    238 
    239 /************************************************************************/
    240 
    241 typedef void (PR_CALLBACK *_PRStartFn)(void *);
    242 
    243 struct PRThread {
    244     PRUint32 state;                 /* thread's creation state */
    245     PRThreadPriority priority;      /* apparent priority, loosly defined */
    246 
    247     void *arg;                      /* argument to the client's entry point */
    248     _PRStartFn startFunc;           /* the root of the client's thread */
    249 
    250     void *environment;              /* pointer to execution environment */
    251 
    252     /*
    253     ** Per thread private data
    254     */
    255     PRUint32 tpdLength;             /* thread's current vector length */
    256     void **privateData;             /* private data vector or NULL */
    257 
    258     pthread_t id;                   /* pthread identifier for the thread */
    259     PRBool okToDelete;              /* ok to delete the PRThread struct? */
    260     void *sp;                       /* recorded sp for garbage collection */
    261     PRThread *next, *prev;          /* simple linked list of all threads */
    262     PRUint32 suspend;               /* used to store suspend and resume flags */
    263 #ifdef PT_NO_SIGTIMEDWAIT
    264     pthread_mutex_t suspendResumeMutex;
    265     pthread_cond_t suspendResumeCV;
    266 #endif
    267     PRUint32 interrupt_blocked;     /* interrupt blocked */
    268     struct pollfd *syspoll_list;    /* Unix polling list used by PR_Poll */
    269     PRUint32 syspoll_count;         /* number of elements in syspoll_list */
    270 };
    271 
    272 struct PRProcess {
    273     _MDProcess md;
    274 };
    275 
    276 /************************************************************************/
    277 
    278 extern void _PR_InitSegs(void);
    279 extern void _PR_InitStacks(void);
    280 extern void _PR_InitMem(void);
    281 extern void _PR_InitIO(void);
    282 extern void _PR_InitLog(void);
    283 extern void _PR_InitNet(void);
    284114extern void _PR_InitClock(void);
    285 extern void _PR_InitCPUs(void);
    286 extern void _PR_InitMW(void);
    287 extern void _PR_NotifyCondVar(PRCondVar *cvar, PRThread *me);
    288 extern void _PR_CleanupThread(PRThread *thread);
    289 extern void _PR_CleanupMW(void);
    290 extern void _PR_CleanupIO(void);
    291 extern void _PR_CleanupNet(void);
    292 extern void _PR_CleanupLayerCache(void);
    293 extern void _PR_CleanupStacks(void);
    294 #ifdef WINNT
    295 extern void _PR_CleanupCPUs(void);
    296 #endif
    297 extern void _PR_CleanupThreads(void);
    298 extern void _PR_CleanupTPD(void);
    299 extern void _PR_Cleanup(void);
    300 extern void _PR_LogCleanup(void);
    301 extern void _PR_InitLayerCache(void);
    302115
    303116extern PRBool _pr_initialized;
    304117extern void _PR_ImplicitInitialization(void);
    305 
    306 /************************************************************************/
    307 
    308 struct PRSegment {
    309     void *vaddr;
    310     PRUint32 size;
    311     PRUintn flags;
    312 };
    313 
    314 /* PRSegment.flags */
    315 #define _PR_SEG_VM    0x1
    316 
    317 /************************************************************************/
    318 
    319 extern PRInt32 _pr_pageSize;
    320 extern PRInt32 _pr_pageShift;
    321118
    322119/*************************************************************************
     
    334131#define    _PR_MD_FINAL_INIT _MD_FINAL_INIT
    335132
    336 /* Process control */
    337 
    338 #ifdef _MD_CREATE_PROCESS_DETACHED
    339 # define _PR_MD_CREATE_PROCESS_DETACHED _MD_CREATE_PROCESS_DETACHED
    340 #endif
    341 
    342133/* Current Time */
    343134NSPR_API(PRTime) _PR_MD_NOW(void);
    344135#define    _PR_MD_NOW _MD_NOW
    345 
    346 /* Environment related */
    347 extern char* _PR_MD_GET_ENV(const char *name);
    348 #define    _PR_MD_GET_ENV _MD_GET_ENV
    349 
    350 extern PRIntn _PR_MD_PUT_ENV(const char *name);
    351 #define    _PR_MD_PUT_ENV _MD_PUT_ENV
    352 
    353 /* Atomic operations */
    354 
    355 extern void _PR_MD_INIT_ATOMIC(void);
    356 #define    _PR_MD_INIT_ATOMIC _MD_INIT_ATOMIC
    357 
    358 extern PRInt32 _PR_MD_ATOMIC_INCREMENT(PRInt32 *);
    359 #define    _PR_MD_ATOMIC_INCREMENT _MD_ATOMIC_INCREMENT
    360 
    361 extern PRInt32 _PR_MD_ATOMIC_ADD(PRInt32 *, PRInt32);
    362 #define    _PR_MD_ATOMIC_ADD _MD_ATOMIC_ADD
    363 
    364 extern PRInt32 _PR_MD_ATOMIC_DECREMENT(PRInt32 *);
    365 #define    _PR_MD_ATOMIC_DECREMENT _MD_ATOMIC_DECREMENT
    366 
    367 extern PRInt32 _PR_MD_ATOMIC_SET(PRInt32 *, PRInt32);
    368 #define    _PR_MD_ATOMIC_SET _MD_ATOMIC_SET
    369136
    370137/* Time intervals */
     
    376143#define _PR_MD_INTERVAL_PER_SEC _MD_INTERVAL_PER_SEC
    377144
    378 /* Affinity masks */
    379 
    380 extern PRInt32 _PR_MD_SETTHREADAFFINITYMASK(PRThread *thread, PRUint32 mask );
    381 #define _PR_MD_SETTHREADAFFINITYMASK _MD_SETTHREADAFFINITYMASK
    382 
    383 extern PRInt32 _PR_MD_GETTHREADAFFINITYMASK(PRThread *thread, PRUint32 *mask);
    384 #define _PR_MD_GETTHREADAFFINITYMASK _MD_GETTHREADAFFINITYMASK
    385 
    386 /* File locking */
    387 
    388 extern PRStatus _PR_MD_LOCKFILE(PRInt32 osfd);
    389 #define    _PR_MD_LOCKFILE _MD_LOCKFILE
    390 
    391 extern PRStatus _PR_MD_TLOCKFILE(PRInt32 osfd);
    392 #define    _PR_MD_TLOCKFILE _MD_TLOCKFILE
    393 
    394 extern PRStatus _PR_MD_UNLOCKFILE(PRInt32 osfd);
    395 #define    _PR_MD_UNLOCKFILE _MD_UNLOCKFILE
    396 
    397 /* Socket call error code */
    398 
    399 NSPR_API(PRInt32) _PR_MD_GET_SOCKET_ERROR(void);
    400 #define    _PR_MD_GET_SOCKET_ERROR _MD_GET_SOCKET_ERROR
    401 
    402 /* Get name of current host */
    403 extern PRStatus _PR_MD_GETHOSTNAME(char *name, PRUint32 namelen);
    404 #define    _PR_MD_GETHOSTNAME _MD_GETHOSTNAME
    405 
    406145PR_END_EXTERN_C
    407146
  • trunk/src/libs/xpcom18a4/nsprpub/pr/src/misc/prinit.c

    r102211 r102215  
    7070    _PR_InitClock();
    7171
    72     _PR_InitThreads(PR_USER_THREAD, PR_PRIORITY_NORMAL, 0);
    73 
    7472    _PR_MD_FINAL_INIT();
    7573}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette