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

Side by Side Diff: Source/wtf/TCSpinLock.h

Issue 23600014: Rename OS(UNIX) to OS(POSIX) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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
« no previous file with comments | « Source/wtf/StringExtras.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2005, 2006, Google Inc. 1 // Copyright (c) 2005, 2006, Google Inc.
2 // Copyright (c) 2010, Patrick Gansterer <paroga@paroga.com> 2 // Copyright (c) 2010, Patrick Gansterer <paroga@paroga.com>
3 // All rights reserved. 3 // All rights reserved.
4 // 4 //
5 // Redistribution and use in source and binary forms, with or without 5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are 6 // modification, are permitted provided that the following conditions are
7 // met: 7 // met:
8 // 8 //
9 // * Redistributions of source code must retain the above copyright 9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer. 10 // notice, this list of conditions and the following disclaimer.
(...skipping 16 matching lines...) Expand all
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 30
31 // --- 31 // ---
32 // Author: Sanjay Ghemawat <opensource@google.com> 32 // Author: Sanjay Ghemawat <opensource@google.com>
33 33
34 #ifndef TCMALLOC_INTERNAL_SPINLOCK_H__ 34 #ifndef TCMALLOC_INTERNAL_SPINLOCK_H__
35 #define TCMALLOC_INTERNAL_SPINLOCK_H__ 35 #define TCMALLOC_INTERNAL_SPINLOCK_H__
36 36
37 #if OS(UNIX) 37 #if OS(POSIX)
38 #include <sched.h> 38 #include <sched.h>
39 #endif 39 #endif
40 40
41 #include <pthread.h> 41 #include <pthread.h>
42 42
43 // Portable version 43 // Portable version
44 struct TCMalloc_SpinLock { 44 struct TCMalloc_SpinLock {
45 pthread_mutex_t private_lock_; 45 pthread_mutex_t private_lock_;
46 46
47 inline void Init() { 47 inline void Init() {
(...skipping 28 matching lines...) Expand all
76 inline explicit TCMalloc_SpinLockHolder(TCMalloc_SpinLock* l) 76 inline explicit TCMalloc_SpinLockHolder(TCMalloc_SpinLock* l)
77 : lock_(l) { l->Lock(); } 77 : lock_(l) { l->Lock(); }
78 inline ~TCMalloc_SpinLockHolder() { lock_->Unlock(); } 78 inline ~TCMalloc_SpinLockHolder() { lock_->Unlock(); }
79 }; 79 };
80 80
81 // Short-hands for convenient use by tcmalloc.cc 81 // Short-hands for convenient use by tcmalloc.cc
82 typedef TCMalloc_SpinLock SpinLock; 82 typedef TCMalloc_SpinLock SpinLock;
83 typedef TCMalloc_SpinLockHolder SpinLockHolder; 83 typedef TCMalloc_SpinLockHolder SpinLockHolder;
84 84
85 #endif // TCMALLOC_INTERNAL_SPINLOCK_H__ 85 #endif // TCMALLOC_INTERNAL_SPINLOCK_H__
OLDNEW
« no previous file with comments | « Source/wtf/StringExtras.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698