summaryrefslogtreecommitdiffstats
path: root/base/lock_impl.h
diff options
context:
space:
mode:
authorjar@google.com <jar@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-21 23:37:02 +0000
committerjar@google.com <jar@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-21 23:37:02 +0000
commit3cdb6a704df743d914e67850f909b497b7e5ad5c (patch)
treeb343dae90fa83293846cfa1a58a6d2904fb81271 /base/lock_impl.h
parent68c245d774ca1ef9c9b11ea352ed22ac8c5f939c (diff)
downloadchromium_src-3cdb6a704df743d914e67850f909b497b7e5ad5c.zip
chromium_src-3cdb6a704df743d914e67850f909b497b7e5ad5c.tar.gz
chromium_src-3cdb6a704df743d914e67850f909b497b7e5ad5c.tar.bz2
Move windows specific lock-recursion-counter into windows impl file
Unix implementation of lock leaks the underlying lock_impl_ member so that the condition variable implementation can directly acquire and release the lock (without going through our abstract interface). This causse the recursion counter to become incorrect on such platforms. Windows uses an implementation of condition variables that uses our abstract interface, and hence is the only implementation that can track the recursion count (and besides... windows is the only platform that currently allows recursive (multiple) acquisitions of a lock by a single thread. I'll work on gracefully removing the depricated lock.cc after I've landed this change. r=cpu Review URL: http://codereview.chromium.org/7660 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3703 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/lock_impl.h')
-rw-r--r--base/lock_impl.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/base/lock_impl.h b/base/lock_impl.h
index 4bd27dc..b3b6237 100644
--- a/base/lock_impl.h
+++ b/base/lock_impl.h
@@ -48,6 +48,13 @@ class LockImpl {
private:
OSLockType os_lock_;
+#if !defined(NDEBUG) && defined(OS_WIN)
+ // All private data is implicitly protected by lock_.
+ // Be VERY careful to only access members under that lock.
+ int32 recursion_count_shadow_;
+ bool recursion_used_; // Allow debugging to continued after a DCHECK().
+#endif // NDEBUG
+
DISALLOW_COPY_AND_ASSIGN(LockImpl);
};