]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
common: pthread_cond_signal: don't need lock
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Thu, 20 Jan 2011 13:43:22 +0000 (05:43 -0800)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Thu, 20 Jan 2011 13:53:05 +0000 (05:53 -0800)
commit6c85b10bad66ae2e7e7f4476ae92c5aa2b7221f0
tree5480d9e5b4d64323b2977aded40502676c33c274
parent715bbcabd9da808a16eb47ba7eebdd30bb3ae8e4
common: pthread_cond_signal: don't need lock

from the man page:

The pthread_cond_broadcast() or pthread_cond_signal() functions may be
called by a thread whether or not it currently owns the mutex that
threads calling pthread_cond_wait() or pthread_cond_timedwait() have
associated with the condition variable during their waits.

The man page goes on to suggest that sometimes you might want to hold
the lock when signalling. This would be the case if you had some
other variable that could only change when the lock was held, and you
wanted to ensure that that variable did not change prior to the waiter
being woken. That is not the case here, so it's irrelevant.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/common/WorkQueue.h
src/osd/OSD.cc