pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:1885:    return 0;   }      #ifdef UNIX_THREADS   int num_lwps = 1;   #endif      /*! @class Thread    */    - /*! @decl void create(function(mixed...:void) f, mixed ... args) + /*! @decl void create(function(mixed...:mixed|void) f, mixed ... args)    *!    *! This function creates a new thread which will run simultaneously    *! to the rest of the program. The new thread will call the function    *! @[f] with the arguments @[args]. When @[f] returns the thread will cease    *! to exist.    *!    *! All Pike functions are 'thread safe' meaning that running    *! a function at the same time from different threads will not corrupt    *! any internal data in the Pike process.    *!
pike.git/src/threads.c:3344:    end_class("thread_local", 0);    ADD_EFUN("thread_local", f_thread_local,    tFunc(tNone,tObjIs_THREAD_LOCAL),    OPT_EXTERNAL_DEPEND);       START_NEW_PROGRAM_ID(THREAD_ID);    thread_storage_offset=ADD_STORAGE(struct thread_state);    PIKE_MAP_VARIABLE("result", OFFSETOF(thread_state, result),    tMix, T_MIXED, 0);    ADD_FUNCTION("create",f_thread_create, -  tFuncV(tNone,tMixed,tVoid), +  tFuncV(tMixed,tMixed,tVoid),    ID_PROTECTED);    ADD_FUNCTION("backtrace",f_thread_backtrace,tFunc(tNone,tArray),0);    ADD_FUNCTION("wait",f_thread_id_result,tFunc(tNone,tMix),0);    ADD_FUNCTION("status",f_thread_id_status,tFunc(tNone,tInt),0);    ADD_FUNCTION("_sprintf",f_thread_id__sprintf,tFunc(tNone,tStr),0);    ADD_FUNCTION("id_number",f_thread_id_id_number,tFunc(tNone,tInt),0);    ADD_FUNCTION("interrupt", f_thread_id_interrupt,    tFunc(tOr(tVoid,tStr), tVoid), 0);    ADD_FUNCTION("kill", f_thread_id_kill, tFunc(tNone, tVoid), 0);    set_gc_recurse_callback(thread_was_recursed);