Um, duh. orc_init() can be called when the once mutex is held.
void
orc_init (void)
{
- static int inited = FALSE;
+ static volatile int inited = FALSE;
if (!inited) {
- orc_once_mutex_lock ();
+ orc_global_mutex_lock ();
if (!inited) {
ORC_ASSERT(sizeof(OrcExecutor) == sizeof(OrcExecutorAlt));
inited = TRUE;
}
- orc_once_mutex_unlock ();
+ orc_global_mutex_unlock ();
}
}
}
}
} else {
- fprintf(output, " static int p_inited = 0;\n");
+ fprintf(output, " static volatile int p_inited = 0;\n");
if (use_code) {
fprintf(output, " static OrcCode *c = 0;\n");
} else {