pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: threads.c,v 1.193 2003/03/05 16:18:30 mast Exp $ + || $Id: threads.c,v 1.194 2003/03/31 18:31:03 grubba Exp $   */      #include "global.h" - RCSID("$Id: threads.c,v 1.193 2003/03/05 16:18:30 mast Exp $"); + RCSID("$Id: threads.c,v 1.194 2003/03/31 18:31:03 grubba Exp $");      PMOD_EXPORT int num_threads = 1;   PMOD_EXPORT 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:1960:    OPT_EXTERNAL_DEPEND);       /* 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)    Pike_fatal("Failed to initialize thread program!\n");    -  Pike_interpreter.thread_id=clone_object(thread_id_prog,0); +  { +  struct object *o = Pike_interpreter.thread_id = +  clone_object(thread_id_prog,0);    SWAP_OUT_THREAD(OBJ2THREAD(Pike_interpreter.thread_id)); /* Init struct */ -  +  Pike_interpreter.thread_id = o;    OBJ2THREAD(Pike_interpreter.thread_id)->id=th_self();    OBJ2THREAD(Pike_interpreter.thread_id)->swapped=0;    thread_table_insert(Pike_interpreter.thread_id);    } -  + }      void th_cleanup(void)   {    th_running = 0;       if(Pike_interpreter.thread_id)    {    thread_table_delete(Pike_interpreter.thread_id);    destruct(Pike_interpreter.thread_id);    free_object(Pike_interpreter.thread_id);