mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-27 20:25:44 +00:00
Bug 1447964 - Improve CurrentThreadCanAccessZone() check r=jandem
This commit is contained in:
parent
1747f82987
commit
076cbcc6be
@ -1497,7 +1497,7 @@ LeaveParseTaskZone(JSRuntime* rt, ParseTask* task)
|
|||||||
{
|
{
|
||||||
// Mark the zone as no longer in use by a helper thread, and available
|
// Mark the zone as no longer in use by a helper thread, and available
|
||||||
// to be collected by the GC.
|
// to be collected by the GC.
|
||||||
rt->clearUsedByHelperThread(task->parseGlobal->zone());
|
rt->clearUsedByHelperThread(task->parseGlobal->zoneFromAnyThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
ParseTask*
|
ParseTask*
|
||||||
|
@ -914,11 +914,12 @@ js::CurrentThreadCanAccessRuntime(const JSRuntime* rt)
|
|||||||
bool
|
bool
|
||||||
js::CurrentThreadCanAccessZone(Zone* zone)
|
js::CurrentThreadCanAccessZone(Zone* zone)
|
||||||
{
|
{
|
||||||
if (CurrentThreadCanAccessRuntime(zone->runtime_))
|
// Helper thread zones can only be used by their owning thread.
|
||||||
return true;
|
if (zone->usedByHelperThread())
|
||||||
|
return zone->group()->ownedByCurrentThread();
|
||||||
|
|
||||||
// Only zones marked for use by a helper thread can be used off thread.
|
// Other zones can only be accessed by the runtime's active context.
|
||||||
return zone->usedByHelperThread() && zone->group()->ownedByCurrentThread();
|
return CurrentThreadCanAccessRuntime(zone->runtime_);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
Loading…
Reference in New Issue
Block a user