Branch: Tag:

2015-09-02

2015-09-02 15:44:22 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Threads: this_thread() needs to survive cleanup on exit.

There apparently are some lfun::destroy() that call this_thread()
at a time when Pike_interpreter.thread_state->thread_obj is NULL.

2016:   PMOD_EXPORT void f_this_thread(INT32 args)   {    pop_n_elems(args); -  if (Pike_interpreter.thread_state) { +  if (Pike_interpreter.thread_state && +  Pike_interpreter.thread_state->thread_obj) {    ref_push_object(Pike_interpreter.thread_state->thread_obj);    } else {    /* Threads not enabled yet/anylonger */