Branch: Tag:

2018-02-09

2018-02-09 10:34:40 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Threads: threads_disable() needs to lock the pike compiler too.

Fixes deadlock when one thread holds the compiler lock, and another
disables threads followed by attempting to compile some code.

Fixes PIKE-62 (#8062).

851:    /* Keep this the entire session. */    mt_lock(&interleave_lock);    +  lock_pike_compiler(); +     im = (IMUTEX_T *)interleave_list;       while(im) {
868:    /* Keep this the entire session. */    mt_lock(&interleave_lock);    +  lock_pike_compiler(); +     im = (IMUTEX_T *)interleave_list;       while(im) {
947:    im = im->next;    }    +  unlock_pike_compiler(); +     mt_unlock(&interleave_lock);       THREADS_FPRINTF(0, (stderr, "exit_threads_disable(): Wake up!\n"));