pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:1:   #include "global.h" - RCSID("$Id: threads.c,v 1.175 2001/11/12 15:59:11 mast Exp $"); + RCSID("$Id: threads.c,v 1.176 2001/11/26 14:58:54 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:760:    )    thread_table_delete(Pike_interpreter.thread_id);    free_object(Pike_interpreter.thread_id);    Pike_interpreter.thread_id=0;    num_threads--;    if(!num_threads && threads_evaluator_callback)    {    remove_callback(threads_evaluator_callback);    threads_evaluator_callback=0;    } +  /* FIXME: What about threads_disable? */    mt_unlock_interpreter();    th_exit(0);    /* NOT_REACHED, but removes a warning */    return(0);   }      #ifdef UNIX_THREADS   int num_lwps = 1;   #endif   
pike.git/src/threads.c:1386:      /*! @decl mixed result()    *!    *! Waits for the thread to complete, and then returns    *! the value returned from the thread function.    */   static void f_thread_id_result(INT32 args)   {    struct thread_state *th=THIS_THREAD;    +  if (threads_disabled) { +  Pike_error("Cannot wait for threads when threads are disabled!\n"); +  } +     SWAP_OUT_CURRENT_THREAD();       while(th->status != THREAD_EXITED)    co_wait_interpreter(&th->status_change);       SWAP_IN_CURRENT_THREAD();       low_object_index_no_free(Pike_sp,    Pike_fp->current_object,    thread_id_result_variable);