Bug 1279293 Comment 183 Edit History

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

So this keeps spinning in my mind as a nested event loop... Just a guess, but I see basically two ways how we can end up in this situation:

1. Unexpected thread death without cleanup
If a thread could die unexpectedly without cleaning up our in-process-memory book-keeping (maybe by some interrupt?) and then we arrive later in `nsThread::Shutdown()`, we would still be able to dispatch an event to its queue and then wait forever for the shutdown ack message to come. It is not ´clear to me how this could happen, but it would be nice if there was a (system) function to check, if a thread handle is really alive before we even try to shut it down.

2. Failed dispatch of shutdown ack to main thread
This is basically comment 181. Just setting `context->mAwaitingShutdownAck` might not be enough in this situation if there are no more other messages on the main thread.

Any other thoughts, Kris?
So this keeps spinning in my mind as a nested event loop... Just a guess, but I see basically two ways how we can end up in this situation:

1. Unexpected thread death without cleanup
If a thread could die unexpectedly without cleaning up our in-process-memory book-keeping (maybe by some interrupt?) and then we arrive later in `nsThread::Shutdown()`, we would still be able to dispatch an event to its queue and then wait forever for the shutdown ack message to come. It is not clear to me how this could happen, but it would be nice if there was a (system) function to check, if a thread handle is really alive before we even try to shut it down.

2. Failed dispatch of shutdown ack to main thread
This is basically comment 181. Just setting `context->mAwaitingShutdownAck` might not be enough in this situation if there are no more other messages on the main thread.

Any other thoughts, Kris?
So this keeps spinning in my mind as a nested event loop... Just a guess, but I see basically two ways how we can end up in this situation:

1. Unexpected thread death without cleanup
If a thread could die unexpectedly without cleaning up our in-process-memory book-keeping (maybe by some interrupt?) and then we arrive later in `nsThread::Shutdown()`, we would still be able to dispatch an event to its queue and then wait forever for the shutdown ack message to come. It is not clear to me how this could happen, but it would be nice if there was a (system) function to check, if a thread handle is really alive before we even try to shut it down.

2. Failed dispatch of shutdown ack to main thread
This is basically comment 181. Just setting `context->mAwaitingShutdownAck` might not be enough in this situation if there are no more other messages on the main thread, though?

Any other thoughts, Kris?

Back to Bug 1279293 Comment 183