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.228 2003/11/25 17:58:24 jonasw Exp $ + || $Id: threads.c,v 1.229 2003/11/26 10:51:10 grubba Exp $   */      #ifndef CONFIGURE_TEST   #include "global.h" - RCSID("$Id: threads.c,v 1.228 2003/11/25 17:58:24 jonasw Exp $"); + RCSID("$Id: threads.c,v 1.229 2003/11/26 10:51:10 grubba Exp $");      PMOD_EXPORT int num_threads = 1;   PMOD_EXPORT int threads_disabled = 0;   #endif /* !CONFIGURE_TEST */      #ifdef _REENTRANT      #ifndef CONFIGURE_TEST      #include "threads.h"
pike.git/src/threads.c:726: Inside #if undefined(HAVE_NO_YIELD)
   if(div_++ & 255)    return;   #ifdef HAVE_GETHRTIME    {    static hrtime_t last_ = 0;    hrtime_t now = gethrtime();    if( now-last_ < 50000000 ) /* 0.05s slice */    return;    last_ = now;    } - #elif HAVE_MACH_TASK_INFO_H + #elif defined(HAVE_MACH_TASK_INFO_H) && defined(TASK_THREAD_TIMES_INFO)    {    static struct timeval last_check = { 0, 0 };    task_thread_times_info_data_t info;    mach_msg_type_number_t info_size = TASK_THREAD_TIMES_INFO_COUNT;       /* Get user time and test if 50usec has passed since last check. */    if (task_info(mach_task_self(), TASK_THREAD_TIMES_INFO,    (task_info_t) &info, &info_size) == 0) {    /* Compute difference by converting kernel time_info_t to timeval. */    struct timeval now;