Bug 1649974 - P1. Make WeakPtr work with generic taskqueue. r=froydnj

It worked until now as IPC's MessageChannel was only used with background taskqueue; which use a threadpool made of a single thread only.

Differential Revision: https://phabricator.services.mozilla.com/D82499
This commit is contained in:
Jean-Yves Avenard 2020-07-08 03:58:18 +00:00
Родитель 9a6c0a0bd5
Коммит 9194155201
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -98,12 +98,12 @@
// on a single thread. The following macros implement assertions for
// checking these conditions.
//
// We re-use XPCOM's nsAutoOwningThread checks when they are available. This has
// the advantage that it works with cooperative thread pools.
// We re-use XPCOM's nsAutoOwningEventTarget checks when they are available.
// This has the advantage that it works with cooperative thread pools.
# define MOZ_WEAKPTR_DECLARE_THREAD_SAFETY_CHECK \
/* Will be none if mPtr = nullptr. */ \
Maybe<nsAutoOwningThread> _owningThread;
Maybe<nsAutoOwningEventTarget> _owningThread;
# define MOZ_WEAKPTR_INIT_THREAD_SAFETY_CHECK() \
do { \
if (p) { \