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

Unified 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: Add a log message pointing to bug Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/synchronization/lock_impl_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/synchronization/lock_impl.h
===================================================================
--- base/synchronization/lock_impl.h (revision 107048)
+++ base/synchronization/lock_impl.h (working copy)
@@ -17,6 +17,18 @@
#include "base/base_export.h"
#include "base/basictypes.h"
+#if defined(OS_MACOSX) && !defined(NDEBUG)
+// For Mac debug builds, do some extra checks to make sure a LockImpl is not
+// used after it has been freed. This instrumentation is to help track down
+// spurious locking errors (EINVAL) which are happening on the bots.
+// In particular, I want to make sure they aren't a consequence of having
+// used a freed lock object (which can happen for instance when trying to
+// post tasks to a destroyed MessageLoop).
+// See http://crbug.com/102161 for more details. This instrumentation can be
+// removed once that bug has been identified.
+#define LOCK_IMPL_CHECK_LIVENESS
+#endif
+
namespace base {
namespace internal {
@@ -53,6 +65,17 @@
#endif
private:
+#ifdef LOCK_IMPL_CHECK_LIVENESS
+ enum LivenessToken {
+ LT_ALIVE = 0xCa11ab1e, // 3390155550
+ LT_DELETED = 0xDecea5ed, // 3738084845
+ };
+
+ void CheckIsAlive();
+
+ LivenessToken liveness_token_;
+#endif // LOCK_IMPL_CHECK_LIVENESS
+
OSLockType os_lock_;
DISALLOW_COPY_AND_ASSIGN(LockImpl);
« 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