summaryrefslogtreecommitdiffstats
path: root/base/lock.h
Commit message (Collapse)AuthorAgeFilesLines
* Test was examining a variable without first acquiring a required Lock.ralphl@chromium.org2009-03-191-1/+1
| | | | | | | Also changed Lock::AssertAcquired to be const function (it already was const, in practice, just not declared that way). Review URL: http://codereview.chromium.org/42402 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12157 0039d316-1c4b-4281-b951-d872f2087c98
* Added a debug method AssertAcquired() that compiles to nothing in non-debug ↵ralphl@chromium.org2009-03-181-11/+18
| | | | | | | | | | | | | | | | | builds. In debug builds, the method will DCHECK if the current thread does not hold the lock. I also removed a class that was not being used (AutoLockImpl) which seems like someone just copied the Lock.h file and blindly added an Impl for the AutoLock class. Thre are places in my code where I want to use the AutoUnlock class. I can't see why it was restricted to use by the condition variable class only, so I just made it into a regular class with no restrictions. I noticed that JamesR posted a CL about a month ago that made AutoUnlock a public class, but it was never committed, so I added him to this CL for review too. Review URL: http://codereview.chromium.org/48109 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12037 0039d316-1c4b-4281-b951-d872f2087c98
* NO CODE CHANGEdeanm@chromium.org2009-03-101-1/+0
| | | | | | | | | Normalize end of file newlines in base/. All files end in a single newline. Review URL: http://codereview.chromium.org/42011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11329 0039d316-1c4b-4281-b951-d872f2087c98
* Move windows specific lock-recursion-counter into windows impl filejar@google.com2008-10-211-23/+6
| | | | | | | | | | | | | | | | | | | | 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
* Disallow recursive locking via the Lock classjar@google.com2008-10-091-32/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 Review URL: http://codereview.chromium.org/5630 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3105 0039d316-1c4b-4281-b951-d872f2087c98
* Some small cleanups to Lock suggested by Gaetano Mendola.deanm@chromium.org2008-10-011-1/+1
| | | | | | Review URL: http://codereview.chromium.org/6037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2754 0039d316-1c4b-4281-b951-d872f2087c98
* Use a more compact license header in source files.license.bot2008-08-241-28/+4
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1287 0039d316-1c4b-4281-b951-d872f2087c98
* Port LockImpl, Lock, and ConditionVariable to pthreads-supporting platforms.mmentovai@google.com2008-08-081-5/+10
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@567 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the LOCKED_EXPRESSION macro, it's clumbsy and unused.deanm@google.com2008-08-071-8/+0
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@506 0039d316-1c4b-4281-b951-d872f2087c98
* Add base to the repository.initial.commit2008-07-261-0/+122
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8 0039d316-1c4b-4281-b951-d872f2087c98