Bug 1610585 Comment 9 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Timeline of WorkerPrivate::mBusyCount increment/decrements:

+ (CompileScriptRunnable PreDispatch)

+ (InitializeWorkerRunnable PreDispatch)

+ (LoadAllScript's StrongWorkerRef ctor)

- (LoadAllScript's StrongWorkerRef dtor)

- (CompileScriptRunnable PostRun)

- (InitializeWorkerRunnable PostRun)

+ (MessagePortIdentifierRunnable creates a MessagePort, which creates a StrongWorkerRef)
(importScript's LoadAllScript's StrongWorkerRef ctor) (no increment busy count b\c MessagePort already has StrongWorkerRef)

+ (NotifyRunnable PreDispatch)

- (NotifyRunnable PostRun) (note: on nested event loop, shouldn't make a difference)

- (MessagePortIdentifierRunnable's WorkerRunnable::Run called when WorkerPrivate::ClearMainEventQueue is on the stack) *** (NOT BALANCED!)

(MessagePort's StrongWorkerRef is destroyed) (no decrement busy count b\c importScript's LoadAllScripts already has StrongWorkerRef)
- (importScript's LoadAllScript's StrongWorkerRef dtor) mBusyCount == 0 -> assertion failure
Timeline of WorkerPrivate::mBusyCount increment/decrements:

+ Increment (CompileScriptRunnable PreDispatch)

+ Increment  (InitializeWorkerRunnable PreDispatch)

+ Increment  (LoadAllScript's StrongWorkerRef ctor)

- Decrement (LoadAllScript's StrongWorkerRef dtor)

- Decrement (CompileScriptRunnable PostRun)

- Decrement (InitializeWorkerRunnable PostRun)

+ Increment (MessagePortIdentifierRunnable creates a MessagePort, which creates a StrongWorkerRef)
(importScript's LoadAllScript's StrongWorkerRef ctor) (no increment busy count b\c MessagePort already has StrongWorkerRef)

+ Increment (NotifyRunnable PreDispatch)

- Decrement (NotifyRunnable PostRun) (note: on nested event loop, shouldn't make a difference)

- Decrement (MessagePortIdentifierRunnable's WorkerRunnable::Run called when WorkerPrivate::ClearMainEventQueue is on the stack) *** (NOT BALANCED!)

(MessagePort's StrongWorkerRef is destroyed) (no decrement busy count b\c importScript's LoadAllScripts already has StrongWorkerRef)
- Decrement (importScript's LoadAllScript's StrongWorkerRef dtor) mBusyCount == 0 -> assertion failure

Back to Bug 1610585 Comment 9