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

Side by Side Diff: base/synchronization/lock_impl.h

Issue 8414031: Temporary instrumentation to help understand lock errors on mac debug bots. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | base/synchronization/lock_impl_posix.cc » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_LOCK_IMPL_H_ 5 #ifndef BASE_SYNCHRONIZATION_LOCK_IMPL_H_
6 #define BASE_SYNCHRONIZATION_LOCK_IMPL_H_ 6 #define BASE_SYNCHRONIZATION_LOCK_IMPL_H_
7 #pragma once 7 #pragma once
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 void Unlock(); 46 void Unlock();
47 47
48 // Return the native underlying lock. Not supported for Windows builds. 48 // Return the native underlying lock. Not supported for Windows builds.
49 // TODO(awalker): refactor lock and condition variables so that this is 49 // TODO(awalker): refactor lock and condition variables so that this is
50 // unnecessary. 50 // unnecessary.
51 #if !defined(OS_WIN) 51 #if !defined(OS_WIN)
52 OSLockType* os_lock() { return &os_lock_; } 52 OSLockType* os_lock() { return &os_lock_; }
53 #endif 53 #endif
54 54
55 private: 55 private:
56 #if defined(OS_MAC) && !defined(NDEBUG)
Mark Mentovai 2011/10/28 19:58:26 This won’t ever work. It’s OS_MACOSX. You can add
eroman 2011/10/28 20:00:53 Thanks Mark! I'll do that, and ping back once I h
57 // Some instrumentation to help track down http://crbug.com/102161. Used to
58 // assert in debug builds when trying to use a freed lock.
59 enum LivenessToken {
60 LT_ALIVE = 0xCa11ab1e,
61 LT_DELETED = 0xDecea5ed,
62 };
63
64 void CheckIsAlive();
65
66 uint32 liveness_token_;
67 #endif
68
56 OSLockType os_lock_; 69 OSLockType os_lock_;
57 70
58 DISALLOW_COPY_AND_ASSIGN(LockImpl); 71 DISALLOW_COPY_AND_ASSIGN(LockImpl);
59 }; 72 };
60 73
61 } // namespace internal 74 } // namespace internal
62 } // namespace base 75 } // namespace base
63 76
64 #endif // BASE_SYNCHRONIZATION_LOCK_IMPL_H_ 77 #endif // BASE_SYNCHRONIZATION_LOCK_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | base/synchronization/lock_impl_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698