Index: unwind-sjlj.c =================================================================== RCS file: /cvsroot/gcc/gcc/gcc/unwind-sjlj.c,v retrieving revision 1.14 diff -u -r1.14 unwind-sjlj.c --- unwind-sjlj.c 7 May 2003 22:11:34 -0000 1.14 +++ unwind-sjlj.c 17 Jul 2003 07:32:46 -0000 @@ -86,8 +86,25 @@ /* Manage the chain of registered function contexts. */ -/* Single threaded fallback chain. */ -static struct SjLj_Function_Context *fc_static; +/* Single threaded(or multithreaded single cpu) fallback + * chain. + * + * Notice that this is a globally visible variable. + * + * The way the single threaded callback chain is extended to a multithreaded + * callback chain, is that the scheduler during a thread switch saves + * the value of this variable in the thread state/structure for the thread + * being switched out, and it restores the value from the thread being + * switched in. + * + * Thread startup routines are modified to initialize this value per thread. + * + * This scheme only works for single CPU systems, but it is an efficient + * and simple method method to add multithreaded + * exceptions to e.g. sources.redhat.com/eCos. + * + */ +struct SjLj_Function_Context *fc_static; #if __GTHREADS static __gthread_key_t fc_key;