[Pcsclite-cvs-commit] r2944 - /trunk/PCSC/src/ifdwrapper.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Mon May 12 08:36:21 UTC 2008


Author: rousseau
Date: Mon May 12 08:36:21 2008
New Revision: 2944

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=2944
Log:
IFDCloseIFD(): use SYS_MutexTryLock() instead of SYS_MutexLock() since
the mutex may be hold by a now dead polling thread

Modified:
    trunk/PCSC/src/ifdwrapper.c

Modified: trunk/PCSC/src/ifdwrapper.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/ifdwrapper.c?rev=2944&op=diff
==============================================================================
--- trunk/PCSC/src/ifdwrapper.c (original)
+++ trunk/PCSC/src/ifdwrapper.c Mon May 12 08:36:21 2008
@@ -14,6 +14,7 @@
  * @brief This wraps the dynamic ifdhandler functions.
  */
 
+#include <errno.h>
 #include "config.h"
 #include "misc.h"
 #include "pcscd.h"
@@ -202,7 +203,9 @@
 	 * LOCK THIS CODE REGION
 	 */
 
-	SYS_MutexLock(rContext->mMutex);
+	rv = SYS_MutexTryLock(rContext->mMutex);
+	if (EBUSY == rv)
+		Log1(PCSC_LOG_ERROR, "Locking failed");
 #ifndef PCSCLITE_STATIC_DRIVER
 	if (rContext->dwVersion == IFD_HVERSION_1_0)
 




More information about the Pcsclite-cvs-commit mailing list