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..3e28ea171b7ba7dc6418584bdc149b99abf4dec9 100644 |
--- a/webrtc/base/sequenced_task_checker_impl.cc |
+++ b/webrtc/base/sequenced_task_checker_impl.cc |
@@ -22,7 +22,13 @@ SequencedTaskCheckerImpl::SequencedTaskCheckerImpl() |
SequencedTaskCheckerImpl::~SequencedTaskCheckerImpl() {} |
bool SequencedTaskCheckerImpl::CalledSequentially() const { |
- TaskQueue* current_queue = TaskQueue::Current(); |
+ QueueId current_queue = TaskQueue::Current(); |
+#if defined(WEBRTC_MAC) |
+ if (current_queue == nullptr) |
+ // If we're not running on a TaskQueue, use the system dispatch queue |
magjed_webrtc
2016/11/02 12:04:41
nit: I would like the comments above the if-statem
tommi
2016/11/02 16:32:50
agree.
style comment: as is, this should use {} si
kthelgason
2016/11/02 16:53:55
Done.
|
+ // label as an identifier. |
+ current_queue = dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL); |
magjed_webrtc
2016/11/02 12:04:41
We don't need any include for this magical dispatc
tommi
2016/11/02 16:32:50
good point. We need #include <dispatch/dispatch.h
kthelgason
2016/11/02 16:53:55
Done.
|
+#endif |
CritScope scoped_lock(&lock_); |
if (!attached_) { // true if previously detached. |
valid_queue_ = current_queue; |