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

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Fri Oct 24 07:27:00 UTC 2008


Author: rousseau
Date: Fri Oct 24 07:26:59 2008
New Revision: 3179

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=3179
Log:
reformat lock/unlock comments

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=3179&op=diff
==============================================================================
--- trunk/PCSC/src/ifdwrapper.c (original)
+++ trunk/PCSC/src/ifdwrapper.c Fri Oct 24 07:26:59 2008
@@ -134,11 +134,9 @@
 		}
 #endif
 
-	/*
-	 * LOCK THIS CODE REGION
-	 */
-
+	/* LOCK THIS CODE REGION */
 	SYS_MutexLock(rContext->mMutex);
+
 #ifndef PCSCLITE_STATIC_DRIVER
 	if (rContext->dwVersion == IFD_HVERSION_1_0)
 	{
@@ -170,11 +168,9 @@
 			rv = IFDHCreateChannel(rContext->dwSlot, rContext->dwPort);
 	}
 #endif
+
+	/* END OF LOCKED REGION */
 	SYS_MutexUnLock(rContext->mMutex);
-
-	/*
-	 * END OF LOCKED REGION
-	 */
 
 	return rv;
 }
@@ -197,10 +193,7 @@
 		IFDH_close_channel = rContext->psFunctions.psFunctions_v2.pvfCloseChannel;
 #endif
 
-	/*
-	 * LOCK THIS CODE REGION
-	 */
-
+	/* TRY TO LOCK THIS CODE REGION */
 	repeat = 5;
 again:
 	rv = SYS_MutexTryLock(rContext->mMutex);
@@ -214,6 +207,7 @@
 			goto again;
 		}
 	}
+
 #ifndef PCSCLITE_STATIC_DRIVER
 	if (rContext->dwVersion == IFD_HVERSION_1_0)
 
@@ -226,11 +220,9 @@
 	else
 		rv = IFDHCloseChannel(rContext->dwSlot);
 #endif
+
+	/* END OF LOCKED REGION */
 	SYS_MutexUnLock(rContext->mMutex);
-
-	/*
-	 * END OF LOCKED REGION
-	 */
 
 	return rv;
 }
@@ -297,10 +289,7 @@
 			rContext->psFunctions.psFunctions_v2.pvfGetCapabilities;
 #endif
 
-	/*
-	 * LOCK THIS CODE REGION
-	 */
-
+	/* LOCK THIS CODE REGION */
 	SYS_MutexLock(rContext->mMutex);
 
 #ifndef PCSCLITE_STATIC_DRIVER
@@ -317,11 +306,8 @@
 			pucValue);
 #endif
 
+	/* END OF LOCKED REGION */
 	SYS_MutexUnLock(rContext->mMutex);
-
-	/*
-	 * END OF LOCKED REGION
-	 */
 
 	return rv;
 }
@@ -364,10 +350,7 @@
 		IFDH_power_icc = rContext->psFunctions.psFunctions_v2.pvfPowerICC;
 #endif
 
-	/*
-	 * LOCK THIS CODE REGION
-	 */
-
+	/* LOCK THIS CODE REGION */
 	SYS_MutexLock(rContext->mMutex);
 
 #ifndef PCSCLITE_STATIC_DRIVER
@@ -394,11 +377,9 @@
 	else
 		rv = IFDHPowerICC(rContext->dwSlot, dwAction, pucAtr, pdwAtrLen);
 #endif
+
+	/* END OF LOCKED REGION */
 	SYS_MutexUnLock(rContext->mMutex);
-
-	/*
-	 * END OF LOCKED REGION
-	 */
 
 	/* use clean values in case of error */
 	if (rv != IFD_SUCCESS)
@@ -452,10 +433,7 @@
 		IFDH_icc_presence = rContext->psFunctions.psFunctions_v2.pvfICCPresence;
 #endif
 
-	/*
-	 * LOCK THIS CODE REGION
-	 */
-
+	/* LOCK THIS CODE REGION */ 
 	SYS_MutexLock(rContext->mMutex);
 
 #ifndef PCSCLITE_STATIC_DRIVER
@@ -477,11 +455,9 @@
 	else
 		rv = IFDHICCPresence(rContext->dwSlot);
 #endif
+
+	/* END OF LOCKED REGION */
 	SYS_MutexUnLock(rContext->mMutex);
-
-	/*
-	 * END OF LOCKED REGION
-	 */
 
 	if (rv == IFD_SUCCESS || rv == IFD_ICC_PRESENT)
 		dwCardStatus |= SCARD_PRESENT;
@@ -516,10 +492,7 @@
 
 			dwTag = TAG_IFD_ATR;
 
-			/*
-			 * LOCK THIS CODE REGION
-			 */
-
+			/* LOCK THIS CODE REGION */ 
 			SYS_MutexLock(rContext->mMutex);
 
 			ucValue[0] = rContext->dwSlot;
@@ -530,11 +503,9 @@
 #else
 			rv = IFD_Get_Capabilities(dwTag, pucAtr);
 #endif
+
+			/* END OF LOCKED REGION */
 			SYS_MutexUnLock(rContext->mMutex);
-
-			/*
-			 * END OF LOCKED REGION
-			 */
 
 			/*
 			 * FIX :: This is a temporary way to return the correct size
@@ -594,9 +565,7 @@
 	IFDH_control_v2 = rContext->psFunctions.psFunctions_v2.pvfControl;
 #endif
 
-	/*
-	 * LOCK THIS CODE REGION
-	 */
+	/* LOCK THIS CODE REGION */
 	SYS_MutexLock(rContext->mMutex);
 
 #ifndef PCSCLITE_STATIC_DRIVER
@@ -606,10 +575,9 @@
 	rv = IFDHControl_v2(rContext->dwSlot, TxBuffer, TxLength,
 		RxBuffer, RxLength);
 #endif
+
+	/* END OF LOCKED REGION */
 	SYS_MutexUnLock(rContext->mMutex);
-	/*
-	 * END OF LOCKED REGION
-	 */
 
 	if (rv == IFD_SUCCESS)
 		return SCARD_S_SUCCESS;
@@ -646,10 +614,7 @@
 	IFDH_control = rContext->psFunctions.psFunctions_v3.pvfControl;
 #endif
 
-	/*
-	 * LOCK THIS CODE REGION
-	 */
-
+	/* LOCK THIS CODE REGION */ 
 	SYS_MutexLock(rContext->mMutex);
 
 #ifndef PCSCLITE_STATIC_DRIVER
@@ -659,11 +624,9 @@
 	rv = IFDHControl(rContext->dwSlot, ControlCode, TxBuffer,
 		TxLength, RxBuffer, RxLength, BytesReturned);
 #endif
+
+	/* END OF LOCKED REGION */
 	SYS_MutexUnLock(rContext->mMutex);
-
-	/*
-	 * END OF LOCKED REGION
-	 */
 
 	if (rv == IFD_SUCCESS)
 		return SCARD_S_SUCCESS;
@@ -710,12 +673,8 @@
 			rContext->psFunctions.psFunctions_v2.pvfTransmitToICC;
 #endif
 
-	/*
-	 * LOCK THIS CODE REGION
-	 */
-
+	/* LOCK THIS CODE REGION */ 
 	SYS_MutexLock(rContext->mMutex);
-
 
 #ifndef PCSCLITE_STATIC_DRIVER
 	if (rContext->dwVersion == IFD_HVERSION_1_0)
@@ -742,11 +701,9 @@
 			(LPBYTE) pucTxBuffer, dwTxLength,
 			pucRxBuffer, pdwRxLength, pioRxPci);
 #endif
+
+	/* END OF LOCKED REGION */
 	SYS_MutexUnLock(rContext->mMutex);
-
-	/*
-	 * END OF LOCKED REGION
-	 */
 
 	/* log the returned status word */
 	DebugLogCategory(DEBUG_CATEGORY_SW, pucRxBuffer, *pdwRxLength);




More information about the Pcsclite-cvs-commit mailing list