pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:1986:    *!    *! @seealso    *! @[Mutex], @[Condition], @[this_thread()]    */   void f_thread_create(INT32 args)   {    struct thread_starter arg;    struct thread_state *thread_state =    (struct thread_state *)Pike_fp->current_storage;    int tmp; -  int orig_threads_disabled = threads_disabled; +        if (args < 1) {    SIMPLE_TOO_FEW_ARGS_ERROR("create", 1);    }    push_svalue(Pike_sp - args);    f_callablep(1);    if (UNSAFE_IS_ZERO(Pike_sp - 1)) {    SIMPLE_BAD_ARG_ERROR("create", 1, "function");    }    pop_stack();
pike.git/src/threads.c:2049:    * since it at this point only has one reference.    *    * We also want the stuff in arg to be copied properly    * before we exit the function...    */    SWAP_OUT_CURRENT_THREAD();    THREADS_FPRINTF(0, (stderr, "f_thread_create %p waiting...\n",    thread_state));    while (thread_state->status == THREAD_NOT_STARTED)    low_co_wait_interpreter (&thread_state->status_change); -  if (!orig_threads_disabled && threads_disabled) { +  if (threads_disabled) {    /* Some other thread disabled threads while we were waiting for    * the cond var. Wait for the threads disabled lock to be released.    */    threads_disabled_wait(DLOC);    }    THREADS_FPRINTF(0, (stderr, "f_thread_create %p continue\n", thread_state));    SWAP_IN_CURRENT_THREAD();    } else {    low_cleanup_interpret(&thread_state->state);    free_array(arg.args);