pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:1:   #include "global.h" - RCSID("$Id: threads.c,v 1.98 1999/06/03 06:10:03 hubbe Exp $"); + RCSID("$Id: threads.c,v 1.99 1999/06/08 21:07:55 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:371:         void thread_table_insert(struct object *o)   {    struct thread_state *s = OBJ2THREAD(o);    unsigned INT32 h = thread_table_hash(&s->id);   #ifdef PIKE_DEBUG    if(h>=THREAD_TABLE_SIZE)    fatal("thread_table_hash failed miserably!\n");    if(thread_state_for_id(s->id)) +  { +  if(thread_state_for_id(s->id) == s)    fatal("Registring thread twice!\n"); -  +  else +  fatal("Forgot to unregister thread!\n"); +  }   /* dumpmem("thread_table_insert",&s->id, sizeof(THREAD_T)); */   #endif    mt_lock( & thread_table_lock );    if((s->hashlink = thread_table_chains[h]) != NULL)    s->hashlink->backlink = &s->hashlink;    thread_table_chains[h] = s;    s->backlink = &thread_table_chains[h];    mt_unlock( & thread_table_lock );   }