TaskQueueWrapper is used in two ways:
- Through the ref-counted CallWorkerThread, which is, well, ref-counted, and
passed around gecko as an AbstractThread. The lifetime of this task queue is
managed by the ref-count and it may be deleted on any thread (bug 1748333...).
- Through the TaskQueueFactory for libwebrtc's internal use. libwebrtc manages
the lifetime of these task queues explicitly, and does not delete them on the
task queue itself.
This patch adds a DeletionPolicy template parameter to TaskQueueWrapper to put
flag up front whether a TaskQueueWrapper will block shutdown or not.
For the former case above we use DeletionPolicy::NonBlocking and for the latter
DeletionPolicy::Blocking.
Differential Revision: https://phabricator.services.mozilla.com/D137292