mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-25 09:57:32 +09:00
Issue #1442 - Part 12a - Allow idle worker shutdown to begin for an opt-in WorkerHolder mode. https://bugzilla.mozilla.org/show_bug.cgi?id=1362444 Pre-requisite for Part 13.
This commit is contained in:
parent
346e8a87d7
commit
41216b88f6
4 changed files with 30 additions and 6 deletions
|
|
@ -73,7 +73,12 @@ class WorkerHolder
|
|||
public:
|
||||
NS_DECL_OWNINGTHREAD
|
||||
|
||||
WorkerHolder();
|
||||
enum Behavior {
|
||||
AllowIdleShutdownStart,
|
||||
PreventIdleShutdownStart,
|
||||
};
|
||||
|
||||
explicit WorkerHolder(Behavior aBehavior = PreventIdleShutdownStart);
|
||||
virtual ~WorkerHolder();
|
||||
|
||||
bool HoldWorker(WorkerPrivate* aWorkerPrivate, Status aFailStatus);
|
||||
|
|
@ -81,6 +86,8 @@ public:
|
|||
|
||||
virtual bool Notify(Status aStatus) = 0;
|
||||
|
||||
Behavior GetBehavior() const;
|
||||
|
||||
protected:
|
||||
void ReleaseWorkerInternal();
|
||||
|
||||
|
|
@ -88,6 +95,8 @@ protected:
|
|||
|
||||
private:
|
||||
void AssertIsOwningThread() const;
|
||||
|
||||
const Behavior mBehavior;
|
||||
};
|
||||
|
||||
END_WORKERS_NAMESPACE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue