[Pcsclite-cvs-commit] r2184 - trunk/PCSC/src
Ludovic Rousseau
rousseau at costa.debian.org
Wed Oct 11 09:32:36 UTC 2006
Author: rousseau
Date: 2006-10-11 09:32:36 +0000 (Wed, 11 Oct 2006)
New Revision: 2184
Modified:
trunk/PCSC/src/winscard.c
Log:
SCardDisconnect(): wait for the lock to be released only if it held by
someone else (and not just by ourself).
Modified: trunk/PCSC/src/winscard.c
===================================================================
--- trunk/PCSC/src/winscard.c 2006-10-11 09:29:31 UTC (rev 2183)
+++ trunk/PCSC/src/winscard.c 2006-10-11 09:32:36 UTC (rev 2184)
@@ -712,8 +712,13 @@
/*
* wait until a possible transaction is finished
*/
- while (rContext->dwLockId != 0)
- SYS_USleep(100000);
+ if ((rContext->dwLockId != 0) && (rContext->dwLockId != hCard))
+ {
+ Log1(PCSC_LOG_INFO, "Waiting for release of lock");
+ while (rContext->dwLockId != 0)
+ SYS_USleep(100000);
+ Log1(PCSC_LOG_INFO, "Lock released");
+ }
/*
* Unlock any blocks on this context
More information about the Pcsclite-cvs-commit
mailing list