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.271 2009/01/25 15:56:54 grubba Exp $ + || $Id: threads.c,v 1.272 2009/01/25 18:05:34 grubba Exp $   */      #include "global.h"      PMOD_EXPORT int num_threads = 1;   PMOD_EXPORT int threads_disabled = 0;      /* #define PICKY_MUTEX */      #ifdef _REENTRANT
pike.git/src/threads.c:247: Inside #if defined(SIMULATE_COND_WITH_EVENT)
   mt_lock(& c->lock);    t=c->head;    mt_unlock(& c->lock);    if(t) return -1;    mt_destroy(& c->lock);    return 0;   }      #else /* !SIMULATE_COND_WITH_EVENT */    + #ifndef CONFIGURE_TEST   PMOD_EXPORT int co_wait_timeout(COND_T *c, PIKE_MUTEX_T *m, int s, int nanos)   {   #ifdef POSIX_THREADS    struct timespec timeout;   #ifdef HAVE_PTHREAD_COND_RELTIMEDWAIT_NP    /* Solaris extension: relative timeout. */    timeout.tv_sec = s;    timeout.tv_nsec = nanos;    return pthread_cond_reltimedwait_np(c, m, &timeout);   #else /* !HAVE_PTHREAD_COND_RELTIMEDWAIT_NP */    /* Absolute timeout. */    GETTIMEOFDAY(&current_time);    timeout.tv_sec = current_time.tv_sec + s;    timeout.tv_nsec = current_time.tv_usec * 1000 + nanos;    return pthread_cond_timedwait(c, m, &timeout);   #endif /* HAVE_PTHREAD_COND_RELTIMEDWAIT_NP */   #else /* !POSIX_THREADS */   #error co_wait_timeout doesn't support this thread model.   #endif /* POSIX_THREADS */   } -  + #endif /* !CONFIGURE_TEST */      #endif /* SIMULATE_COND_WITH_EVENT */      #ifdef POSIX_THREADS   pthread_attr_t pattr;   pthread_attr_t small_pattr;   #endif      static void really_low_th_init(void)   {