pike.git / src / threads.h

version» Context lines:

pike.git/src/threads.h:1:   /* -  * $Id: threads.h,v 1.109 2000/12/16 05:24:41 marcus Exp $ +  * $Id: threads.h,v 1.110 2000/12/16 05:45:45 marcus Exp $    */   #ifndef THREADS_H   #define THREADS_H      #include "machine.h"   #include "object.h"   #include "pike_error.h"   #include "interpret.h"      /* Needed for the sigset_t typedef, which is needed for
pike.git/src/threads.h:63:         /* Restore the fp macro. */   #ifdef FRAMEPOINTER_WAS_DEFINED   #define fp Pike_fp   #undef FRAMEPOINTER_WAS_DEFINED   #endif /* FRAMEPOINTER_WAS_DEFINED */         extern int num_threads; - extern int live_threads; + PMOD_EXPORT extern int live_threads;   struct object; - extern size_t thread_stack_size; + PMOD_EXPORT extern size_t thread_stack_size;      #define DEFINE_MUTEX(X) PIKE_MUTEX_T X         #ifdef POSIX_THREADS      #ifdef HAVE_PTHREAD_ATFORK   #define th_atfork(X,Y,Z) pthread_atfork((X),(Y),(Z))   #define th_atfork_prepare()   #define th_atfork_parent()
pike.git/src/threads.h:284:   typedef struct cond_t_s   {    PIKE_MUTEX_T lock;    struct cond_t_queue *head, *tail;   } COND_T;      #define COND_T struct cond_t_s      #define co_init(X) do { mt_init(& (X)->lock), (X)->head=(X)->tail=0; }while(0)    - int co_wait(COND_T *c, PIKE_MUTEX_T *m); - int co_signal(COND_T *c); - int co_broadcast(COND_T *c); - int co_destroy(COND_T *c); + PMOD_EXPORT int co_wait(COND_T *c, PIKE_MUTEX_T *m); + PMOD_EXPORT int co_signal(COND_T *c); + PMOD_EXPORT int co_broadcast(COND_T *c); + PMOD_EXPORT int co_destroy(COND_T *c);      #endif      extern int th_running;    - extern PIKE_MUTEX_T interpreter_lock; + PMOD_EXPORT extern PIKE_MUTEX_T interpreter_lock;      #if defined(PIKE_DEBUG) && !defined(__NT__)      /* This is a debug wrapper to enable checks that the interpreter lock    * is hold by the current thread. */      extern THREAD_T debug_locking_thread;   #define SET_LOCKING_THREAD (debug_locking_thread = th_self(), 0)      #define mt_lock_interpreter() (mt_lock(&interpreter_lock) || SET_LOCKING_THREAD)
pike.git/src/threads.h:329:      #else      #define mt_lock_interpreter() (mt_lock(&interpreter_lock))   #define mt_trylock_interpreter() (mt_trylock(&interpreter_lock))   #define mt_unlock_interpreter() (mt_unlock(&interpreter_lock))   #define co_wait_interpreter(COND) do {co_wait((COND), &interpreter_lock);} while (0)      #endif    - extern COND_T live_threads_change; /* Used by _disable_threads */ - extern COND_T threads_disabled_change; /* Used by _disable_threads */ + PMOD_EXPORT extern COND_T live_threads_change; /* Used by _disable_threads */ + PMOD_EXPORT extern COND_T threads_disabled_change; /* Used by _disable_threads */      struct svalue;   struct pike_frame;      extern PIKE_MUTEX_T interleave_lock;      struct interleave_mutex   {    struct interleave_mutex *next;    struct interleave_mutex *prev;
pike.git/src/threads.h:593:    unsigned *id);   struct thread_starter;   struct thread_local;   void low_init_threads_disable(void);   void init_threads_disable(struct object *o);   void exit_threads_disable(struct object *o);   void init_interleave_mutex(IMUTEX_T *im);   void exit_interleave_mutex(IMUTEX_T *im);   void thread_table_init(void);   unsigned INT32 thread_table_hash(THREAD_T *tid); - void thread_table_insert(struct object *o); - void thread_table_delete(struct object *o); - struct thread_state *thread_state_for_id(THREAD_T tid); - struct object *thread_for_id(THREAD_T tid); - void f_all_threads(INT32 args); - int count_pike_threads(void); + PMOD_EXPORT void thread_table_insert(struct object *o); + PMOD_EXPORT void thread_table_delete(struct object *o); + PMOD_EXPORT struct thread_state *thread_state_for_id(THREAD_T tid); + PMOD_EXPORT struct object *thread_for_id(THREAD_T tid); + PMOD_EXPORT void f_all_threads(INT32 args); + PMOD_EXPORT int count_pike_threads(void);   TH_RETURN_TYPE new_thread_func(void * data);   void f_thread_create(INT32 args);   void f_thread_set_concurrency(INT32 args); - void f_this_thread(INT32 args); + PMOD_EXPORT void f_this_thread(INT32 args);   struct mutex_storage;   struct key_storage;   void f_mutex_lock(INT32 args);   void f_mutex_trylock(INT32 args);   void init_mutex_obj(struct object *o);   void exit_mutex_obj(struct object *o);   void init_mutex_key_obj(struct object *o);   void exit_mutex_key_obj(struct object *o);   void f_cond_wait(INT32 args);   void f_cond_signal(INT32 args);   void f_cond_broadcast(INT32 args);   void init_cond_obj(struct object *o);   void exit_cond_obj(struct object *o);   void f_thread_backtrace(INT32 args);   void f_thread_id_status(INT32 args);   void init_thread_obj(struct object *o);   void exit_thread_obj(struct object *o); - void f_thread_local(INT32 args); + PMOD_EXPORT void f_thread_local(INT32 args);   void f_thread_local_get(INT32 args);   void f_thread_local_set(INT32 args);   void low_th_init(void);   void th_init(void);   void th_cleanup(void);   int th_num_idle_farmers(void);   int th_num_farmers(void); - void th_farm(void (*fun)(void *), void *here); + PMOD_EXPORT void th_farm(void (*fun)(void *), void *here);   /* Prototypes end here */      #else      #define th_atfork(X,Y,Z)   #define th_atfork_prepare()   #define th_atfork_parent()   #define th_atfork_child()      #define th_setconcurrency(X)
pike.git/src/threads.h:679:   #endif /* PIKE_THREADS */      #ifndef CHECK_INTERPRETER_LOCK   #define CHECK_INTERPRETER_LOCK() do {} while (0)   #endif      #ifdef __NT__   #ifndef PIKE_DEBUG   #define CheckValidHandle(X) (X)   #else - HANDLE CheckValidHandle(HANDLE h); + PMOD_EXPORT HANDLE CheckValidHandle(HANDLE h);   #endif   #endif      extern int threads_disabled; - extern ptrdiff_t thread_storage_offset; - extern struct program *thread_id_prog; + PMOD_EXPORT extern ptrdiff_t thread_storage_offset; + PMOD_EXPORT extern struct program *thread_id_prog;      #ifndef NO_PIKE_SHORTHAND   #define MUTEX_T PIKE_MUTEX_T   #endif         /* Initializer macros for static mutex and condition variables */   #ifdef PTHREAD_MUTEX_INITIALIZER   #define STATIC_MUTEX_INIT = PTHREAD_MUTEX_INITIALIZER   #else