Bug 947683 - Fix --disable-threadsafe shell builds on OS X. r=luke

This commit is contained in:
Jan de Mooij 2013-12-09 18:56:24 +01:00
parent 183ee8ff81
commit 6d867d31ea

View File

@ -744,6 +744,7 @@ AsmJSMachExceptionHandler::AsmJSMachExceptionHandler()
void
AsmJSMachExceptionHandler::uninstall()
{
#ifdef JS_THREADSAFE
if (installed_) {
thread_port_t thread = mach_thread_self();
kern_return_t kret = thread_set_exception_ports(thread,
@ -781,11 +782,15 @@ AsmJSMachExceptionHandler::uninstall()
JS_ASSERT(kret == KERN_SUCCESS);
port_ = MACH_PORT_NULL;
}
#else
JS_ASSERT(!installed_);
#endif
}
bool
AsmJSMachExceptionHandler::install(JSRuntime *rt)
{
#ifdef JS_THREADSAFE
JS_ASSERT(!installed());
kern_return_t kret;
mach_port_t thread;
@ -825,6 +830,9 @@ AsmJSMachExceptionHandler::install(JSRuntime *rt)
error:
uninstall();
return false;
#else
return false;
#endif
}
#else // If not Windows or Mac, assume Unix