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.282 2010/02/18 14:50:41 srb Exp $ + || $Id: threads.c,v 1.283 2010/09/28 16:06:34 mast 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:965: Inside #if defined(PROFILE_CHECK_THREADS)
   gettimeofday (&now, NULL);    if (now.tv_sec > last_time) {    fprintf (stderr, "check_threads calls in %ld sec(s): %lu\n",    (long) (now.tv_sec - last_time), calls);    last_time = (unsigned long) now.tv_sec;    calls = 0;    }    }   #endif    +  pike_thread_yield(); + } +  + PMOD_EXPORT void pike_thread_yield() + {    DEBUG_CHECK_THREAD();       THREADS_ALLOW();    /* Allow other threads to run */    /* FIXME: Ought to use condition vars or something to get another    * thread to run. yield functions are notoriously unreliable and    * poorly defined. It might not really yield we need it to. It might    * make us yield to another process instead of just another thread.    * It might even make us sleep for a short while. */    th_yield();