Fix and assert against some more unsafe cross-thread JSContext use.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 7m10s
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 7m10s
This commit is contained in:
@ -2402,6 +2402,14 @@ tf_trace_t* tf_ssb_get_trace(tf_ssb_t* ssb)
|
||||
|
||||
JSContext* tf_ssb_get_context(tf_ssb_t* ssb)
|
||||
{
|
||||
if (ssb->thread_self && uv_thread_self() != ssb->thread_self)
|
||||
{
|
||||
const char* bt = tf_util_backtrace_string();
|
||||
tf_printf("Acquiring JS context from non-main thread:\n%s\n", bt);
|
||||
tf_free((void*)bt);
|
||||
abort();
|
||||
}
|
||||
|
||||
return ssb->context;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user