pike.git / src / threads.h

version» Context lines:

pike.git/src/threads.h:147:      /*    * No cond_vars yet    */      #endif /* SGI_SPROC_THREADS */         #ifdef NT_THREADS   #include <process.h> + #include <windows.h>      #define THREAD_T HANDLE   #define th_setconcurrency(X) - #define th_create(ID,fun,arg) _beginthreadex(NULL, 2*1024*1024, fun, arg, 0, ID) - #define th_exit(foo) _endthreadex(foo) + #define th_create(ID,fun,arg) (!(*(ID)=_beginthread(fun, 2*1024*1024, arg))) + #define th_exit(foo) _endthread(foo)   #define th_self() GetCurrentThread()   #define th_destroy(X) CloseHandle(*(X))   #define th_yield() Sleep(0)      #define MUTEX_T HANDLE   #define mt_init(X) (*(X)=CreateMutex(NULL, 0, NULL))   #define mt_lock(X) WaitForSingleObject(*(X), INFINITE)   #define mt_trylock(X) WaitForSingleObject(*(X), 0)   #define mt_unlock(X) ReleaseMutex(*(X))   #define mt_destroy(X) CloseHandle(*(X))
pike.git/src/threads.h:182: Inside #if !defined(COND_T) && defined(EVENT_T) && defined(MUTEX_T)
  #if !defined(COND_T) && defined(EVENT_T) && defined(MUTEX_T)      #define SIMULATE_COND_WITH_EVENT      struct cond_t_queue   {    struct cond_t_queue *next;    EVENT_T event;   };    - struct cond_t_s + typedef struct cond_t_s   {    MUTEX_T lock; -  struct cond_t_queue *head, *tail +  struct cond_t_queue *head, *tail;   } COND_T;      #define COND_T struct cond_t_s      #define co_init(X) mt_init(& (X)->lock)      int co_wait(COND_T *c, MUTEX_T *m);   int co_signal(COND_T *c);   int co_broadcast(COND_T *c);   int co_destroy(COND_T *c);
pike.git/src/threads.h:214:   struct frame;      #define THREAD_NOT_STARTED -1   #define THREAD_RUNNING 0   #define THREAD_EXITED 1      struct thread_state {    char swapped;    char status;    COND_T status_change; +  THREAD_T id;       /* Swapped variables */    struct svalue *sp,*evaluator_stack;    struct svalue **mark_sp,**mark_stack;    struct frame *fp;    int evaluator_stack_malloced;    int mark_stack_malloced;    JMP_BUF *recoveries;    struct object * thread_id;   };