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

Side by Side Diff: runtime/vm/os_thread.h

Issue 1402733003: Always define IsOwnedByCurrentThread (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 | « no previous file | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_OS_THREAD_H_ 5 #ifndef VM_OS_THREAD_H_
6 #define VM_OS_THREAD_H_ 6 #define VM_OS_THREAD_H_
7 7
8 #include "platform/globals.h" 8 #include "platform/globals.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 ~Mutex(); 67 ~Mutex();
68 68
69 void Lock(); 69 void Lock();
70 bool TryLock(); 70 bool TryLock();
71 void Unlock(); 71 void Unlock();
72 72
73 #if defined(DEBUG) 73 #if defined(DEBUG)
74 bool IsOwnedByCurrentThread() const { 74 bool IsOwnedByCurrentThread() const {
75 return owner_ == OSThread::GetCurrentThreadId(); 75 return owner_ == OSThread::GetCurrentThreadId();
76 } 76 }
77 #endif // defined(DEBUG) 77 #else
78 bool IsOwnedByCurrentThread() const {
79 UNREACHABLE();
80 return false;
81 }
82 #endif
78 83
79 private: 84 private:
80 MutexData data_; 85 MutexData data_;
81 #if defined(DEBUG) 86 #if defined(DEBUG)
82 ThreadId owner_; 87 ThreadId owner_;
83 #endif // defined(DEBUG) 88 #endif // defined(DEBUG)
84 89
85 DISALLOW_COPY_AND_ASSIGN(Mutex); 90 DISALLOW_COPY_AND_ASSIGN(Mutex);
86 }; 91 };
87 92
(...skipping 25 matching lines...) Expand all
113 MonitorData data_; // OS-specific data. 118 MonitorData data_; // OS-specific data.
114 119
115 DISALLOW_COPY_AND_ASSIGN(Monitor); 120 DISALLOW_COPY_AND_ASSIGN(Monitor);
116 }; 121 };
117 122
118 123
119 } // namespace dart 124 } // namespace dart
120 125
121 126
122 #endif // VM_OS_THREAD_H_ 127 #endif // VM_OS_THREAD_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698