pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:457:    /* The double locking here is to ensure that when a thread releases    * the interpreter lock, a different thread gets it first. Thereby    * we ensure a thread switch in check_threads, if there are other    * threads waiting. */    mt_lock (&interpreter_lock_wanted);    mt_lock (&interpreter_lock);    mt_unlock (&interpreter_lock_wanted);       SET_LOCKING_THREAD;    USE_DLOC_ARGS(); -  THREADS_FPRINTF (1, "Got iplock" DLOC_PF(" @ ",) "\n", DLOC_ARGS_OPT); +  THREADS_FPRINTF (1, "Got iplock @ %s:%d\n", DLOC_ARGS_OPT);   }      PMOD_EXPORT void pike_low_wait_interpreter (COND_T *cond COMMA_DLOC_DECL)   {    USE_DLOC_ARGS(); -  THREADS_FPRINTF (1, -  "Waiting on cond %p without iplock" DLOC_PF(" @ ",) "\n", +  THREADS_FPRINTF (1, "Waiting on cond %p without iplock @ %s:%d\n",    cond, DLOC_ARGS_OPT);    UNSET_LOCKING_THREAD;       /* FIXME: Should use interpreter_lock_wanted here as well. The    * problem is that few (if any) thread libs lets us atomically    * unlock a mutex and wait, and then lock a different mutex. */    co_wait (cond, &interpreter_lock);       SET_LOCKING_THREAD; -  THREADS_FPRINTF (1, -  "Got signal on cond %p with iplock" DLOC_PF(" @ ",) "\n", +  THREADS_FPRINTF (1, "Got signal on cond %p with iplock @ %s:%d\n",    cond, DLOC_ARGS_OPT);   }      PMOD_EXPORT int pike_low_timedwait_interpreter (COND_T *cond,    long sec, long nsec    COMMA_DLOC_DECL)   {    int res;    USE_DLOC_ARGS(); -  THREADS_FPRINTF (1, -  "Waiting on cond %p without iplock" DLOC_PF(" @ ",) "\n", +  THREADS_FPRINTF (1, "Waiting on cond %p without iplock @ %s:%d\n",    cond, DLOC_ARGS_OPT);    UNSET_LOCKING_THREAD;       /* FIXME: Should use interpreter_lock_wanted here as well. The    * problem is that few (if any) thread libs lets us atomically    * unlock a mutex and wait, and then lock a different mutex. */    res = co_wait_timeout (cond, &interpreter_lock, sec, nsec);       SET_LOCKING_THREAD; -  THREADS_FPRINTF (1, -  "Got signal on cond %p with iplock" DLOC_PF(" @ ",) "\n", +  THREADS_FPRINTF (1, "Got signal on cond %p with iplock @ %s:%d\n",    cond, DLOC_ARGS_OPT);    return res;   }      static void threads_disabled_wait (DLOC_DECL)   {    assert (threads_disabled);    USE_DLOC_ARGS();    do { -  THREADS_FPRINTF (1, -  "Waiting on threads_disabled" DLOC_PF(" @ ",) "\n", +  THREADS_FPRINTF (1, "Waiting on threads_disabled @ %s:%d\n",    DLOC_ARGS_OPT);    UNSET_LOCKING_THREAD;    co_wait (&threads_disabled_change, &interpreter_lock);    SET_LOCKING_THREAD;    } while (threads_disabled); -  THREADS_FPRINTF (1, -  "Continue after threads_disabled" DLOC_PF(" @ ",) "\n", +  THREADS_FPRINTF (1, "Continue after threads_disabled @ %s:%d\n",    DLOC_ARGS_OPT);   }      PMOD_EXPORT void pike_lock_interpreter (DLOC_DECL)   {    pike_low_lock_interpreter (DLOC_ARGS_OPT);    if (threads_disabled) threads_disabled_wait (DLOC_ARGS_OPT);   }      PMOD_EXPORT void pike_unlock_interpreter (DLOC_DECL)   {    USE_DLOC_ARGS(); -  THREADS_FPRINTF (1, "Releasing iplock" DLOC_PF(" @ ",) "\n", -  DLOC_ARGS_OPT); +  THREADS_FPRINTF (1, "Releasing iplock @ %s:%d\n", DLOC_ARGS_OPT);    UNSET_LOCKING_THREAD;    mt_unlock (&interpreter_lock);   }      PMOD_EXPORT void pike_wait_interpreter (COND_T *cond COMMA_DLOC_DECL)   {    int owner = threads_disabled;    pike_low_wait_interpreter (cond COMMA_DLOC_ARGS_OPT);    if (!owner && threads_disabled) threads_disabled_wait (DLOC_ARGS_OPT);   }
pike.git/src/threads.c:588: Inside #if defined(USE_CLOCK_FOR_SLICES) and #if defined(PROFILE_CHECK_THREADS)
   fprintf (stderr, "[%d:%f] pike_init_thread_state: tsc reset\n",    getpid(), get_real_time() * (1.0 / CPU_TIME_TICKS));   #endif   #endif   }      PMOD_EXPORT void pike_swap_out_thread (struct thread_state *ts    COMMA_DLOC_DECL)   {    USE_DLOC_ARGS(); -  THREADS_FPRINTF (2, "Swap out %sthread %p" DLOC_PF(" @ ",) "\n", +  THREADS_FPRINTF (2, "Swap out %sthread %p @ %s:%d\n",    ts == Pike_interpreter.thread_state ? "current " : "",    ts, DLOC_ARGS_OPT);      #ifdef PROFILING    if (!ts->swapped) {    cpu_time_t now = get_cpu_time();   #ifdef PROFILING_DEBUG    fprintf(stderr, "%p: Swap out at: %" PRINT_CPU_TIME    " unlocked: %" PRINT_CPU_TIME "\n",    ts, now, ts->state.unlocked_time);
pike.git/src/threads.c:612:   #endif       ts->swapped=1;       Pike_interpreter_pointer = NULL;   }      PMOD_EXPORT void pike_swap_in_thread (struct thread_state *ts    COMMA_DLOC_DECL)   { -  THREADS_FPRINTF (2, "Swap in thread %p" DLOC_PF(" @ ",) "\n", -  ts, DLOC_ARGS_OPT); +  THREADS_FPRINTF (2, "Swap in thread %p @ %s:%d\n", ts, DLOC_ARGS_OPT);      #ifdef PIKE_DEBUG    if (Pike_interpreter_pointer)    pike_fatal_dloc ("Thread %"PRINTSIZET"x swapped in "    "over existing thread %"PRINTSIZET"x.\n",    (size_t) ts->id,    (size_t) (Pike_interpreter.thread_state ?    Pike_interpreter.thread_state->id : 0));   #endif   
pike.git/src/threads.c:907:    pike_threads_disallow (ts COMMA_DLOC_ARGS_OPT);    THREADS_FPRINTF(1, "Locked IMutex %p\n", im);   }      PMOD_EXPORT void pike_unlock_imutex (IMUTEX_T *im COMMA_DLOC_DECL)   {    /* If threads are disabled, we already hold the lock. */    if (threads_disabled) return;       USE_DLOC_ARGS(); -  THREADS_FPRINTF(0, "Unlocking IMutex %p" DLOC_PF(" @ ",) "\n", +  THREADS_FPRINTF(0, "Unlocking IMutex %p @ %s:%d\n",    im, DLOC_ARGS_OPT);    mt_unlock(&(im->lock));   }      /* This is a variant of init_threads_disable that blocks all other    * threads that might run pike code, but still doesn't block the    * THREADS_ALLOW_UID threads. */   void low_init_threads_disable(void)   {    /* Serious black magic to avoid dead-locks */