Windows: use lock conversion in cm_EndDirOp

Instead of dropping the lock for read and reacquiring for write
use lock_ConvertRToW() which will make the change atomicly if
it is possible or place the thread into the wait list if not.

LICENSE MIT

Change-Id: I5d134f045a0c935fdaaef6edf5bdf37bb0418a98
Reviewed-on: http://gerrit.openafs.org/5360
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
This commit is contained in:
Jeffrey Altman 2011-09-05 10:11:09 -04:00 committed by Jeffrey Altman
parent c3e82ee98b
commit 33af0f92e9

View File

@ -1209,8 +1209,9 @@ cm_EndDirOp(cm_dirOp_t * op)
switch (op->lockType) {
case CM_DIRLOCK_READ:
lock_ReleaseRead(&op->scp->dirlock);
/* fall through ... */
lock_ConvertRToW(&op->scp->dirlock);
op->lockType = CM_DIRLOCK_WRITE;
break;
case CM_DIRLOCK_NONE:
lock_ObtainWrite(&op->scp->dirlock);
op->lockType = CM_DIRLOCK_WRITE;