pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:1:   #include "global.h" - RCSID("$Id: threads.c,v 1.82 1998/08/24 20:58:38 marcus Exp $"); + RCSID("$Id: threads.c,v 1.83 1998/08/27 20:43:25 grubba Exp $");      int num_threads = 1;   int threads_disabled = 0;      #ifdef _REENTRANT   #include "threads.h"   #include "array.h"   #include "mapping.h"   #include "object.h"   #include "pike_macros.h"
pike.git/src/threads.c:1045:    add_storage(sizeof(struct thread_state));    thread_id_result_variable=simple_add_variable("result","mixed",0);    add_function("backtrace",f_thread_backtrace,"function(:array)",0);    add_function("wait",f_thread_id_result,"function(:mixed)",0);    add_function("status",f_thread_id_status,"function(:int)",0);    set_gc_mark_callback(thread_was_marked);    set_gc_check_callback(thread_was_checked);    set_init_callback(init_thread_obj);    set_exit_callback(exit_thread_obj);    thread_id_prog=end_program(); +  +  /* Some constants... */ +  add_integer_constant("THREAD_NOT_STARTED", THREAD_NOT_STARTED, 0); +  add_integer_constant("THREAD_RUNNING", THREAD_RUNNING, 0); +  add_integer_constant("THREAD_EXITED", THREAD_EXITED, 0); +     if(!mutex_key)    fatal("Failed to initialize thread program!\n");       thread_id=clone_object(thread_id_prog,0);    SWAP_OUT_THREAD((struct thread_state *)thread_id->storage); /* Init struct */    ((struct thread_state *)thread_id->storage)->swapped=0;    ((struct thread_state *)thread_id->storage)->id=th_self();    thread_table_insert(thread_id);   }