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

Side by Side Diff: base/allocator/partition_allocator/spin_lock.h

Issue 2713903002: Move spin_lock into partition_allocator. (Closed)
Patch Set: Remove unnecessary DEPS line. Created 3 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
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_SYNCHRONIZATION_SPIN_LOCK_H 5 #ifndef BASE_ALLOCATOR_PARTITION_ALLOCATOR_SPIN_LOCK_H
6 #define BASE_SYNCHRONIZATION_SPIN_LOCK_H 6 #define BASE_ALLOCATOR_PARTITION_ALLOCATOR_SPIN_LOCK_H
7 7
8 #include <atomic> 8 #include <atomic>
9 #include <memory> 9 #include <memory>
10 #include <mutex> 10 #include <mutex>
11 11
12 #include "base/base_export.h" 12 #include "base/base_export.h"
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 14
15 // Spinlock is a simple spinlock class based on the standard CPU primitive of 15 // Spinlock is a simple spinlock class based on the standard CPU primitive of
16 // atomic increment and decrement of an int at a given memory address. These are 16 // atomic increment and decrement of an int at a given memory address. These are
(...skipping 25 matching lines...) Expand all
42 // This is called if the initial attempt to acquire the lock fails. It's 42 // This is called if the initial attempt to acquire the lock fails. It's
43 // slower, but has a much better scheduling and power consumption behavior. 43 // slower, but has a much better scheduling and power consumption behavior.
44 BASE_EXPORT void LockSlow(); 44 BASE_EXPORT void LockSlow();
45 45
46 std::atomic_int lock_; 46 std::atomic_int lock_;
47 }; 47 };
48 48
49 } // namespace subtle 49 } // namespace subtle
50 } // namespace base 50 } // namespace base
51 51
52 #endif // BASE_SYNCHRONIZATION_SPIN_LOCK_H 52 #endif // BASE_ALLOCATOR_PARTITION_ALLOCATOR_SPIN_LOCK_H
OLDNEW
« no previous file with comments | « base/allocator/partition_allocator/partition_alloc.cc ('k') | base/allocator/partition_allocator/spin_lock.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698