pike.git / src / threads.h

version» Context lines:

pike.git/src/threads.h:1:   /* -  * $Id: threads.h,v 1.62 1999/02/01 04:11:37 hubbe Exp $ +  * $Id: threads.h,v 1.63 1999/02/01 06:13:16 hubbe Exp $    */   #ifndef THREADS_H   #define THREADS_H      #include "machine.h"   #include "interpret.h"   #include "object.h"   #include "error.h"   #ifdef HAVE_SYS_TYPES_H   /* Needed for pthread_t on OSF/1 */
pike.git/src/threads.h:271:    if (!threads_disabled) { \    THREADS_FPRINTF(0, (stderr, "Unlocking IMutex 0x%08p...\n", (im))); \    mt_unlock(&((im)->lock)); \    } \    } while(0)      #define THREAD_NOT_STARTED -1   #define THREAD_RUNNING 0   #define THREAD_EXITED 1    + #ifdef PIKE_SECURITY + extern struct object *current_creds; + #define DO_IF_SECURITY(X) X + #else + #define DO_IF_SECURITY(X) + #endif +    struct thread_state {    char swapped;    char status;    COND_T status_change;    THREAD_T id;    struct thread_state *hashlink, **backlink;    struct mapping *thread_local;       /* Swapped variables */    struct svalue *sp,*evaluator_stack;    struct svalue **mark_sp,**mark_stack;    struct pike_frame *fp;    int evaluator_stack_malloced;    int mark_stack_malloced;    JMP_BUF *recoveries;    struct object * thread_id;    char *stack_top; -  +  DO_IF_SECURITY(struct object *current_creds;)      #ifdef PROFILING   #ifdef HAVE_GETHRTIME    long long accounted_time;    long long time_base;   #endif   #endif      #ifdef THREAD_TRACE    int t_flag;
pike.git/src/threads.h:363:    (_tmp)->fp=fp;\    (_tmp)->mark_sp=mark_sp;\    (_tmp)->mark_stack=mark_stack;\    (_tmp)->mark_stack_malloced=mark_stack_malloced;\    (_tmp)->recoveries=recoveries;\    (_tmp)->sp=sp; \    (_tmp)->stack_top=stack_top; \    (_tmp)->thread_id=thread_id;\    DO_IF_PROFILING( (_tmp)->accounted_time=accounted_time; ) \    DO_IF_PROFILING( (_tmp)->time_base = gethrtime() - time_base; ) \ +  DO_IF_SECURITY( (_tmp)->current_creds = current_creds ;) \    SWAP_OUT_TRACE(_tmp); \    } while(0)      #define SWAP_IN_THREAD(_tmp) do {\    (_tmp)->swapped=0; \    evaluator_stack=(_tmp)->evaluator_stack;\    evaluator_stack_malloced=(_tmp)->evaluator_stack_malloced;\    fp=(_tmp)->fp;\    mark_sp=(_tmp)->mark_sp;\    mark_stack=(_tmp)->mark_stack;\    mark_stack_malloced=(_tmp)->mark_stack_malloced;\    recoveries=(_tmp)->recoveries;\    sp=(_tmp)->sp;\    stack_top=(_tmp)->stack_top;\    thread_id=(_tmp)->thread_id;\    DO_IF_PROFILING( accounted_time=(_tmp)->accounted_time; ) \    DO_IF_PROFILING( time_base = gethrtime() - (_tmp)->time_base; ) \ -  +  DO_IF_SECURITY( current_creds = (_tmp)->current_creds ;) \    SWAP_IN_TRACE(_tmp); \    } while(0)      #define SWAP_OUT_CURRENT_THREAD() \    do {\    struct thread_state *_tmp=OBJ2THREAD(thread_id); \    SWAP_OUT_THREAD(_tmp); \    THREADS_FPRINTF(1, (stderr, "SWAP_OUT_CURRENT_THREAD() %s:%d t:%08x\n", \    __FILE__, __LINE__, (unsigned int)_tmp->thread_id)) \