Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1163)

Unified Diff: webrtc/base/sequenced_task_checker_impl.cc

Issue 2464383002: Use queue label as id in SequencedTaskChecker when not running on TaskQueue (Closed)
Patch Set: code review Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/sequenced_task_checker_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/sequenced_task_checker_impl.cc
diff --git a/webrtc/base/sequenced_task_checker_impl.cc b/webrtc/base/sequenced_task_checker_impl.cc
index 615f44c2b52e8562c182159748b418c4b40729ce..f03e0b6796156b02df27791536028b9fd8c0c332 100644
--- a/webrtc/base/sequenced_task_checker_impl.cc
+++ b/webrtc/base/sequenced_task_checker_impl.cc
@@ -10,6 +10,10 @@
#include "webrtc/base/sequenced_task_checker_impl.h"
+#if defined(WEBRTC_MAC)
+#include <dispatch/dispatch.h>
+#endif
+
#include "webrtc/base/platform_thread.h"
#include "webrtc/base/sequenced_task_checker.h"
#include "webrtc/base/task_queue.h"
@@ -22,7 +26,13 @@ SequencedTaskCheckerImpl::SequencedTaskCheckerImpl()
SequencedTaskCheckerImpl::~SequencedTaskCheckerImpl() {}
bool SequencedTaskCheckerImpl::CalledSequentially() const {
- TaskQueue* current_queue = TaskQueue::Current();
+ QueueId current_queue = TaskQueue::Current();
+#if defined(WEBRTC_MAC)
+ // If we're not running on a TaskQueue, use the system dispatch queue
+ // label as an identifier.
+ if (current_queue == nullptr)
+ current_queue = dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL);
+#endif
CritScope scoped_lock(&lock_);
if (!attached_) { // true if previously detached.
valid_queue_ = current_queue;
« no previous file with comments | « webrtc/base/sequenced_task_checker_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698