pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:1:   #include "global.h" - RCSID("$Id: threads.c,v 1.129 2000/06/10 11:52:44 mast Exp $"); + RCSID("$Id: threads.c,v 1.130 2000/06/24 00:48:13 hubbe 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:1224:       START_NEW_PROGRAM_ID(THREAD_MUTEX_KEY);    mutex_key_offset = ADD_STORAGE(struct key_storage);    /* This is needed to allow the gc to find the possible circular reference.    * It also allows a process to take over ownership of a key.    */    map_variable("_owner", "object", 0,    mutex_key_offset + OFFSETOF(key_storage, owner), T_OBJECT);    set_init_callback(init_mutex_key_obj);    set_exit_callback(exit_mutex_key_obj); -  mutex_key=new_program; +  mutex_key=Pike_compiler->new_program;    add_ref(mutex_key);    end_class("mutex_key", 0);    mutex_key->flags|=PROGRAM_DESTRUCT_IMMEDIATE;   #ifdef PIKE_DEBUG    if(!mutex_key)    fatal("Failed to initialize mutex_key program!\n");   #endif       START_NEW_PROGRAM_ID(THREAD_MUTEX);    ADD_STORAGE(struct mutex_storage);
pike.git/src/threads.c:1263:    ADD_FUNCTION("broadcast",f_cond_broadcast,tFunc(tNone,tVoid),0);    set_init_callback(init_cond_obj);    set_exit_callback(exit_cond_obj);    end_class("condition", 0);       {    struct program *tmp;    START_NEW_PROGRAM_ID(THREAD_DISABLE_THREADS);    set_init_callback(init_threads_disable);    set_exit_callback(exit_threads_disable); -  tmp = new_program; +  tmp = Pike_compiler->new_program;    add_ref(tmp);    end_class("threads_disabled", 0);    tmp->flags|=PROGRAM_DESTRUCT_IMMEDIATE;    add_global_program("_disable_threads", tmp);    free_program(tmp);    }       START_NEW_PROGRAM_ID(THREAD_LOCAL);    ADD_STORAGE(struct thread_local);    /* function(:mixed) */    ADD_FUNCTION("get",f_thread_local_get,tFunc(tNone,tMix),0);    /* function(mixed:mixed) */    ADD_FUNCTION("set",f_thread_local_set,tFunc(tMix,tMix),0); -  thread_local_prog=new_program; +  thread_local_prog=Pike_compiler->new_program;    add_ref(thread_local_prog);    end_class("thread_local", 0);    if(!thread_local_prog)    fatal("Failed to initialize thread_local program!\n");    /* function(:object(thread_local)) */    ADD_EFUN("thread_local",f_thread_local,    tFunc(tNone,tObjIs_THREAD_LOCAL),    OPT_SIDE_EFFECT);       START_NEW_PROGRAM_ID(THREAD_ID);
pike.git/src/threads.c:1301:    ADD_FUNCTION("backtrace",f_thread_backtrace,tFunc(tNone,tArray),0);    /* function(:mixed) */    ADD_FUNCTION("wait",f_thread_id_result,tFunc(tNone,tMix),0);    /* function(:int) */    ADD_FUNCTION("status",f_thread_id_status,tFunc(tNone,tInt),0);    ADD_FUNCTION("_sprintf",f_thread_id__sprintf,tFunc(tNone,tStr),0);    set_gc_recurse_callback(thread_was_recursed);    set_gc_check_callback(thread_was_checked);    set_init_callback(init_thread_obj);    set_exit_callback(exit_thread_obj); -  thread_id_prog=new_program; +  thread_id_prog=Pike_compiler->new_program;    thread_id_prog->flags |= PROGRAM_NO_EXPLICIT_DESTRUCT;    add_ref(thread_id_prog);    end_class("thread_id", 0);       /* function(mixed ...:object(thread_id)) */    ADD_EFUN("thread_create",f_thread_create,    tFuncV(tNone,tMixed,tObjIs_THREAD_ID),    OPT_SIDE_EFFECT);       /* function(:object(thread_id)) */