pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:915:    if (Pike_interpreter.thread_state) {    /* Threads have been enabled. */       IMUTEX_T *im;       THREADS_ALLOW();       /* Keep this the entire session. */    mt_lock(&interleave_lock);    +  lock_pike_compiler(); +     im = (IMUTEX_T *)interleave_list;       while(im) {    mt_lock(&(im->lock));       im = im->next;    }       THREADS_DISALLOW();    } else {    /* Threads haven't been enabled yet. */       IMUTEX_T *im;       /* Keep this the entire session. */    mt_lock(&interleave_lock);    -  +  lock_pike_compiler(); +     im = (IMUTEX_T *)interleave_list;       while(im) {    mt_lock(&(im->lock));       im = im->next;    }    }       THREADS_FPRINTF(0, "low_init_threads_disable(): Disabling threads.\n");
pike.git/src/threads.c:1013:    IMUTEX_T *im = (IMUTEX_T *)interleave_list;    threads_disabled_acc_time += get_real_time() - threads_disabled_start;       /* Order shouldn't matter for unlock, so no need to do it backwards. */    while(im) {    THREADS_FPRINTF(0, "exit_threads_disable(): Unlocking IM %p\n", im);    mt_unlock(&(im->lock));    im = im->next;    }    +  unlock_pike_compiler(); +     mt_unlock(&interleave_lock);       THREADS_FPRINTF(0, "exit_threads_disable(): Wake up!\n");    co_broadcast(&threads_disabled_change);   #ifdef PIKE_DEBUG    threads_disabled_thread = 0;   #endif    }   #ifdef PIKE_DEBUG    } else {