* flock.cc (lf_setlock): Don't close waited lock object handle before

we own the node lock.  Fix comment.
This commit is contained in:
Corinna Vinschen 2012-02-14 13:55:45 +00:00
parent 8895d962d5
commit a8c8f19a43
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2012-02-14 Corinna Vinschen <corinna@vinschen.de>
* flock.cc (lf_setlock): Don't close waited lock object handle before
we own the node lock. Fix comment.
2012-02-14 Corinna Vinschen <corinna@vinschen.de>
* cygheap.cc (init_cygheap::init_installation_root): Convert function

View File

@ -1039,11 +1039,11 @@ lf_setlock (lockf_t *lock, inode_t *node, lockf_t **clean, HANDLE fhdl)
DWORD ret = WaitForMultipleObjects (wait_count, w4, FALSE,
proc ? INFINITE : 100L);
SetThreadPriority (GetCurrentThread (), old_prio);
/* Always close handles before locking the node. */
NtClose (obj);
if (proc)
CloseHandle (proc);
node->LOCK ();
/* Never close lock object handle outside of node lock! */
NtClose (obj);
if (ret == WAIT_SIGNAL_ARRIVED)
{
/* A signal came in. */