[Pcsclite-cvs-commit] r6458 - /trunk/PCSC/src/readerfactory.h

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Thu Sep 13 15:35:12 UTC 2012


Author: rousseau
Date: Thu Sep 13 15:35:12 2012
New Revision: 6458

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=6458
Log:
Make hLockId field volatile

The ReaderContext structure is accessed from different pcscd threads. To
prevent the compiler to optimise read access to the hLockId field we
make it volatile.

That may be the source of a problem when a reader is removed but pcscd
do not behave correctly.

Thanks to Torsten Hilbrich for the idea.
http://archives.neohapsis.com/archives/dev/muscle/2012-q3/0086.html

Modified:
    trunk/PCSC/src/readerfactory.h

Modified: trunk/PCSC/src/readerfactory.h
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/readerfactory.h?rev=6458&op=diff
==============================================================================
--- trunk/PCSC/src/readerfactory.h (original)
+++ trunk/PCSC/src/readerfactory.h Thu Sep 13 15:35:12 2012
@@ -102,7 +102,7 @@
 		int version;			/**< IFD Handler version number */
 		int port;				/**< Port ID */
 		int slot;				/**< Current Reader Slot */
-		SCARDHANDLE hLockId;	/**< Lock Id */
+		volatile SCARDHANDLE hLockId;	/**< Lock Id */
 		int LockCount;			/**< number of recursive locks */
 		int32_t contexts;		/**< Number of open contexts */
 		int * pFeeds;			/**< Number of shared client to lib */




More information about the Pcsclite-cvs-commit mailing list