[Pcsclite-cvs-commit] r6361 - /trunk/PCSC/src/winscard_clnt.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Tue Jun 26 14:15:54 UTC 2012


Author: rousseau
Date: Tue Jun 26 14:15:54 2012
New Revision: 6361

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=6361
Log:
Similar patch as in revision 6358 but for SCardReconnect()

Thanks to Aleksey Samsonov for the patch
http://archives.neohapsis.com/archives/dev/muscle/2012-q2/0109.html

Modified:
    trunk/PCSC/src/winscard_clnt.c

Modified: trunk/PCSC/src/winscard_clnt.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/winscard_clnt.c?rev=6361&op=diff
==============================================================================
--- trunk/PCSC/src/winscard_clnt.c (original)
+++ trunk/PCSC/src/winscard_clnt.c Tue Jun 26 14:15:54 2012
@@ -954,6 +954,9 @@
 	if (rv == -1)
 		return SCARD_E_INVALID_HANDLE;
 
+	/* Retry loop for blocking behaviour */
+retry:
+
 	(void)pthread_mutex_lock(currentContextMap->mMutex);
 
 	/* check the handle is still valid */
@@ -965,9 +968,6 @@
 		 * -> so the mMutex has been unlocked */
 		return SCARD_E_INVALID_HANDLE;
 
-	/* Retry loop for blocking behaviour */
-retry:
-
 	scReconnectStruct.hCard = hCard;
 	scReconnectStruct.dwShareMode = dwShareMode;
 	scReconnectStruct.dwPreferredProtocols = dwPreferredProtocols;
@@ -994,6 +994,7 @@
 
 	if (sharing_shall_block && (SCARD_E_SHARING_VIOLATION == rv))
 	{
+		(void)pthread_mutex_unlock(currentContextMap->mMutex);
 		(void)SYS_USleep(PCSCLITE_LOCK_POLL_RATE);
 		goto retry;
 	}




More information about the Pcsclite-cvs-commit mailing list