pike.git / src / threads.h

version» Context lines:

pike.git/src/threads.h:1:   /* -  * $Id: threads.h,v 1.119 2003/05/07 21:01:03 mast Exp $ +  * $Id: threads.h,v 1.120 2003/12/13 20:37:53 jonasw Exp $    */   #ifndef THREADS_H   #define THREADS_H      #include "machine.h"   #include "object.h"   #include "pike_error.h"   #include "interpret.h"   #include "main.h"   
pike.git/src/threads.h:42:   #include <thread.h>   #undef HAVE_PTHREAD_H   #undef HAVE_THREAD_H   #endif   #endif /* _UNIX_THREADS */      #ifdef _MIT_POSIX_THREADS   #define POSIX_THREADS   #include <pthread.h>    + #ifdef HAVE_MACH_TASK_INFO_H + #include <mach/task_info.h> + #endif + #ifdef HAVE_MACH_TASK_H + #include <mach/task.h> + #endif + #ifdef HAVE_MACH_MACH_INIT_H + #include <mach/mach_init.h> + #endif +    /* AIX is *STUPID* - Hubbe */   #undef func_data      #undef HAVE_PTHREAD_H   #endif /* _MIT_POSIX_THREADS */      #ifdef _SGI_SPROC_THREADS   /* Not supported yet */   #undef SGI_SPROC_THREADS   #undef HAVE_SPROC
pike.git/src/threads.h:148:   #define mt_destroy(X) pthread_mutex_destroy(X)      /* SIGH! No setconcurrency in posix threads. This is more or less    * needed to make usable multi-threaded programs on solaris machines    * with only one CPU. Otherwise, only systemcalls are actually    * threaded.    */   #define th_setconcurrency(X)   #ifdef HAVE_PTHREAD_YIELD   #define th_yield() pthread_yield() + #else + #ifdef HAVE_PTHREAD_YIELD_NP + /* Some pthread libs define yield as non-portable function. */ + #define th_yield() pthread_yield_np() + #endif /* HAVE_PTHREAD_YIELD_NP */   #endif /* HAVE_PTHREAD_YIELD */   extern pthread_attr_t pattr;   extern pthread_attr_t small_pattr;      #define th_create(ID,fun,arg) pthread_create(ID,&pattr,fun,arg)   #define th_create_small(ID,fun,arg) pthread_create(ID,&small_pattr,fun,arg)   #define th_exit(foo) pthread_exit(foo)   #define th_self() pthread_self()      #define TH_KEY_T pthread_key_t   #define th_key_create pthread_key_create   #define th_setspecific pthread_setspecific   #define th_getpecific pthread_getspecific         #ifdef HAVE_PTHREAD_KILL   #define th_kill(ID,sig) pthread_kill((ID),(sig))   #else /* !HAVE_PTHREAD_KILL */ - /* MacOS X (aka Darwin) doesn't have pthread_kill. */ + /* MacOS X (aka Darwin) prior to 10.2 doesn't have pthread_kill. */   #define th_kill(ID,sig)   #endif /* HAVE_PTHREAD_KILL */   #define th_join(ID,res) pthread_join((ID),(res))   #ifdef HAVE_PTHREAD_COND_INIT   #define COND_T pthread_cond_t      #ifdef HAVE_PTHREAD_CONDATTR_DEFAULT_AIX   /* AIX wants the & ... */   #define co_init(X) pthread_cond_init((X), &pthread_condattr_default)   #else /* !HAVE_PTHREAD_CONDATTR_DEFAULT_AIX */
pike.git/src/threads.h:458:   #endif      #ifndef th_equal   #define th_equal(X,Y) (!MEMCMP(&(X),&(Y),sizeof(THREAD_T)))   #endif      #ifndef th_hash   #define th_hash(X) hashmem((unsigned char *)&(X),sizeof(THREAD_T), 16)   #endif    - #if !defined(HAVE_GETHRTIME) && defined(HAVE_CLOCK) + #if !defined(HAVE_GETHRTIME) && \ +  !(defined(HAVE_MACH_TASK_INFO_H) && defined(TASK_THREAD_TIMES_INFO)) && \ +  defined(HAVE_CLOCK) && \ +  !defined(HAVE_NO_YIELD)   #ifdef HAVE_TIME_H   #include <time.h>   #endif   PMOD_EXPORT extern clock_t thread_start_clock;   #define USE_CLOCK_FOR_SLICES   #define DO_IF_USE_CLOCK_FOR_SLICES(X) X   #else   #define DO_IF_USE_CLOCK_FOR_SLICES(X)   #endif