зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1447964 - Improve CurrentThreadCanAccessZone() check r=jandem
This commit is contained in:
Родитель
1747f82987
Коммит
076cbcc6be
|
@ -1497,7 +1497,7 @@ LeaveParseTaskZone(JSRuntime* rt, ParseTask* task)
|
|||
{
|
||||
// Mark the zone as no longer in use by a helper thread, and available
|
||||
// to be collected by the GC.
|
||||
rt->clearUsedByHelperThread(task->parseGlobal->zone());
|
||||
rt->clearUsedByHelperThread(task->parseGlobal->zoneFromAnyThread());
|
||||
}
|
||||
|
||||
ParseTask*
|
||||
|
|
|
@ -914,11 +914,12 @@ js::CurrentThreadCanAccessRuntime(const JSRuntime* rt)
|
|||
bool
|
||||
js::CurrentThreadCanAccessZone(Zone* zone)
|
||||
{
|
||||
if (CurrentThreadCanAccessRuntime(zone->runtime_))
|
||||
return true;
|
||||
// Helper thread zones can only be used by their owning thread.
|
||||
if (zone->usedByHelperThread())
|
||||
return zone->group()->ownedByCurrentThread();
|
||||
|
||||
// Only zones marked for use by a helper thread can be used off thread.
|
||||
return zone->usedByHelperThread() && zone->group()->ownedByCurrentThread();
|
||||
// Other zones can only be accessed by the runtime's active context.
|
||||
return CurrentThreadCanAccessRuntime(zone->runtime_);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
|
Загрузка…
Ссылка в новой задаче