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

Side by Side Diff: base/task_scheduler/scheduler_lock_impl.h

Issue 1706123002: TaskScheduler [2/9] Scheduler Lock (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef BASE_TASK_SCHEDULER_SCHEDULER_LOCK_IMPL_H
6 #define BASE_TASK_SCHEDULER_SCHEDULER_LOCK_IMPL_H
7
8 #include "base/base_export.h"
9 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/synchronization/lock.h"
12
13 namespace base {
14
15 class ConditionVariable;
16
17 namespace internal {
18
19 // A regular lock with simple deadlock correctness checking.
20 // This lock tracks all of the available locks to make sure that any locks are
21 // acquired in an expected order. It serves as the primary lock in the scheduler
22 // when DCHECK_IS_ON() via inheritance by SchedulerLock.
23 class BASE_EXPORT SchedulerLockImpl {
24 public:
25 SchedulerLockImpl();
26 explicit SchedulerLockImpl(const SchedulerLockImpl* predecessor);
27 ~SchedulerLockImpl();
28
29 void Acquire();
30 void Release();
31
32 scoped_ptr<ConditionVariable> CreateConditionVariable();
33
34 private:
35 Lock lock_;
36
37 DISALLOW_COPY_AND_ASSIGN(SchedulerLockImpl);
38 };
39
40 } // namespace internal
41 } // namespace base
42
43 #endif // BASE_TASK_SCHEDULER_SCHEDULER_LOCK_IMPL_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698