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

Issue 5630: Disallow Lock class support for recursive locking (Closed)

Created:
12 years, 2 months ago by jar (doing other things)
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com, darin (slow to review)
Visibility:
Public.

Description

Disallow recursive locking via the Lock class Change contract so that Posix locks (which deadlock on attempts by a single thread to acquire a mutex recursively) and windows critical sections can both be used to implement the Lock() cass, by disallowing recursive locking. In DEBUG mode only, we watch for (now) illegal use of recursive locking. Also remove a pile of cruft that has built up in this file as various folks have re-re-refactored and moved around code. Note that Window's condition variable implementation still uses the AutoUnlock() helper class, but now the implementation (sans nested locking) is very trivial. Posix will probably use their own CV implementation. r=mbelshe Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=3105

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -113 lines) Patch
M base/lock.h View 1 2 3 4 5 4 chunks +23 lines, -32 lines 0 comments Download
M base/lock.cc View 1 2 3 4 5 2 chunks +23 lines, -81 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
jar (doing other things)
12 years, 2 months ago (2008-10-01 17:42:49 UTC) #1
Dean McNamee
A bunch of nits, but if you're not up for them, I can try to ...
12 years, 2 months ago (2008-10-01 17:49:45 UTC) #2
cpu_(ooo_6.6-7.5)
- The DCHECKs inside #ifndef NDEBUG() should be CHECK()s - Do we have unittests? I ...
12 years, 2 months ago (2008-10-01 18:32:43 UTC) #3
Mike Belshe
lgtm
12 years, 2 months ago (2008-10-01 19:48:46 UTC) #4
cpu_(ooo_6.6-7.5)
lgtm
12 years, 2 months ago (2008-10-02 00:14:56 UTC) #5
jar (doing other things)
Specific feedback comments on several of the suggestions (most of which are "done"). Reviewers need ...
12 years, 2 months ago (2008-10-03 00:26:45 UTC) #6
jar (doing other things)
12 years, 2 months ago (2008-10-08 23:48:25 UTC) #7
I removed the controversial DEBUG only lock or barrier from the destructor,
along with the DCHECK.  As pointed out by cpu, the value of the assertion was
less than the controversy it was generating.

The landing appears to break a unit test code that sky can resolve, and so I'm
going to land with the DCHECK commented out for him to fix and finalize on.  

The code appeared to otherwise pass base, net, and unit_test suites (in debug
and release) on my machine with the DCHECK enabled.

Powered by Google App Engine
This is Rietveld 408576698