pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:1:   #include "global.h" - RCSID("$Id: threads.c,v 1.59 1998/03/10 03:14:55 per Exp $"); + RCSID("$Id: threads.c,v 1.60 1998/03/18 20:22:32 per Exp $");      int num_threads = 1;   int threads_disabled = 0;      #ifdef _REENTRANT   #include "threads.h"   #include "array.h"   #include "object.h"   #include "pike_macros.h"   #include "callback.h"
pike.git/src/threads.c:885:    _num_farmers++;    me->neighbour = 0;    me->field = args;    me->harvest = fun;    co_init( &me->harvest_moon );   #ifdef UNIX_THREADS    thr_create(NULL,8192,farm,(void *)me,THR_DAEMON|THR_DETACHED|THR_BOUND,0);   #else    th_create_small(&me->me, farm, me);   #endif +  return me;   }      void th_farm(void (*fun)(void *), void *here)   {    if(!fun) fatal("The farmers don't known how to handle empty fields\n");    mt_lock( &rosie );    if(farmers)    {    struct farmer *f = farmers;    farmers = f->neighbour;    mt_unlock( &rosie );    f->field = here;    f->harvest = fun;    co_signal( &f->harvest_moon );    return;    }    mt_unlock( &rosie );    new_farmer( fun, here );   }   #endif