Branch: Tag:

2018-09-12

2018-09-12 13:10:50 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Threads: Fixed call of lock_pike_compiler() in threads_disable().

lock_pike_compiler() must not be called when threads have been allowed.

Fixes PIKE-126 (#8126) (and PIKE-62 (#8062)).

841:    THREADS_FPRINTF(0,    (stderr, "low_init_threads_disable(): Locking IM's...\n"));    +  lock_pike_compiler(); +     if (Pike_interpreter.thread_state) {    /* Threads have been enabled. */   
851:    /* Keep this the entire session. */    mt_lock(&interleave_lock);    -  lock_pike_compiler(); -  +     im = (IMUTEX_T *)interleave_list;       while(im) {
870:    /* Keep this the entire session. */    mt_lock(&interleave_lock);    -  lock_pike_compiler(); -  +     im = (IMUTEX_T *)interleave_list;       while(im) {