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.275 2009/03/13 16:22:31 mast Exp $ + || $Id: threads.c,v 1.276 2009/03/13 21:03:47 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:951: Inside #if defined(PROFILE_CHECK_THREADS)
   last_time = (unsigned long) now.tv_sec;    calls = 0;    }    }   #endif       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();    THREADS_DISALLOW();      #ifdef USE_CLOCK_FOR_SLICES    /* If we didn't yield then give ourselves a new time slice. If we    * did yield then thread_start_clock is the current clock anyway    * after the thread swap in. */    thread_start_clock = clock();   #ifdef PIKE_DEBUG    if (last_clocked_thread != th_self())