pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:1:   #include "global.h" - RCSID("$Id: threads.c,v 1.134 2000/08/10 09:51:52 per Exp $"); + RCSID("$Id: threads.c,v 1.135 2000/08/10 18:25:17 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:206:   #endif   PMOD_EXPORT MUTEX_T interpreter_lock;   MUTEX_T thread_table_lock, interleave_lock;   struct program *mutex_key = 0;   struct program *thread_id_prog = 0;   struct program *thread_local_prog = 0;   #ifdef POSIX_THREADS   pthread_attr_t pattr;   pthread_attr_t small_pattr;   #endif - PMOD_EXPORT int thread_storage_offset; + PMOD_EXPORT ptrdiff_t thread_storage_offset;      struct thread_starter   {    struct object *id;    struct array *args;   #ifdef HAVE_BROKEN_LINUX_THREAD_EUID    int euid, egid;   #endif /* HAVE_BROKEN_LINUX_THREAD_EUID */   };   
pike.git/src/threads.c:521:       pop_n_elems(args);    oldsp = Pike_sp;    mt_lock( & thread_table_lock );    for(x=0; x<THREAD_TABLE_SIZE; x++)    for(s=thread_table_chains[x]; s; s=s->hashlink) {    struct object *o = THREADSTATE2OBJ(s);    ref_push_object(o);    }    mt_unlock( & thread_table_lock ); -  f_aggregate(Pike_sp-oldsp); +  f_aggregate(DO_NOT_WARN(Pike_sp - oldsp));   }         PMOD_EXPORT int count_pike_threads(void)   {    return num_pike_threads;   }      static void check_threads(struct callback *cb, void *arg, void * arg2)   {
pike.git/src/threads.c:671:    Pike_interpreter.thread_id=0;    num_threads--;    if(!num_threads && threads_evaluator_callback)    {    remove_callback(threads_evaluator_callback);    threads_evaluator_callback=0;    }    mt_unlock_interpreter();    th_exit(0);    /* NOT_REACHED, but removes a warning */ -  return(NULL); +  return(0);   }      #ifdef UNIX_THREADS   int num_lwps = 1;   #endif      void f_thread_create(INT32 args)   {    THREAD_T dummy;    struct thread_starter *arg;
pike.git/src/threads.c:1214: Inside #if defined(POSIX_THREADS)
  #endif    pthread_attr_setdetachstate(&small_pattr, PTHREAD_CREATE_DETACHED);       th_running = 1;   #endif   }      void th_init(void)   {    struct program *tmp; -  INT32 mutex_key_offset; +  ptrdiff_t mutex_key_offset;      #ifdef UNIX_THREADS      /* function(int:void) */    ADD_EFUN("thread_set_concurrency",f_thread_set_concurrency,tFunc(tInt,tVoid), OPT_SIDE_EFFECT);   #endif       START_NEW_PROGRAM_ID(THREAD_MUTEX_KEY);    mutex_key_offset = ADD_STORAGE(struct key_storage);    /* This is needed to allow the gc to find the possible circular reference.
pike.git/src/threads.c:1422:   /* fprintf(stderr, "farm_end %p\n", me); */       me->harvest = 0;    mt_lock( &rosie );    if( ++_num_idle_farmers > 16 )    {    --_num_idle_farmers;    --_num_farmers;    mt_unlock( &rosie );    free( me ); -  return NULL; +  return 0;    }    me->neighbour = farmers;    farmers = me;   /* fprintf(stderr, "farm_wait %p\n", me); */    while(!me->harvest) co_wait( &me->harvest_moon, &rosie );    --_num_idle_farmers;    mt_unlock( &rosie );   /* fprintf(stderr, "farm_endwait %p\n", me); */    } while(1);    /* NOT_REACHED */ -  return NULL;/* Keep the compiler happy. */ +  return 0;/* Keep the compiler happy. */   }      int th_num_idle_farmers(void)   {    return _num_idle_farmers;   }         int th_num_farmers(void)   {