[Pcsclite-cvs-commit] r2478 - trunk/PCSC/src

Ludovic Rousseau rousseau at alioth.debian.org
Tue Mar 13 09:56:30 CET 2007


Author: rousseau
Date: 2007-03-13 08:56:30 +0000 (Tue, 13 Mar 2007)
New Revision: 2478

Modified:
   trunk/PCSC/src/winscard_clnt.c
Log:
profiling: the mechanism does not work correctly when threads are used.
Display warnings in that case.


Modified: trunk/PCSC/src/winscard_clnt.c
===================================================================
--- trunk/PCSC/src/winscard_clnt.c	2007-03-13 08:29:08 UTC (rev 2477)
+++ trunk/PCSC/src/winscard_clnt.c	2007-03-13 08:56:30 UTC (rev 2478)
@@ -92,7 +92,8 @@
 
 	/* PROFILE_END was not called before? */
 	if (profile_tty && fct_name[0])
-		printf("\33[01;34m ERROR: lost return value of %s\33[0m\n", fct_name);
+		printf("\33[01;34m WARNING: %s starts before %s finishes\33[0m\n",
+			f, fct_name);
 
 	strlcpy(fct_name, f, sizeof(fct_name));
 
@@ -125,6 +126,10 @@
 
 	if (profile_tty)
 	{
+		if (strncmp(fct_name, f, sizeof(fct_name)))
+			printf("\33[01;34m WARNING: %s ends before %s\33[0m\n",
+					f, fct_name);
+
 		/* allow to detect missing PROFILE_END calls */
 		fct_name[0] = '\0';
 
@@ -2087,6 +2092,7 @@
 			if ((dwTime >= (dwTimeout * 1000)) && (j == 0))
 			{
 				SYS_MutexUnLock(psContextMap[dwContextIndex].mMutex);
+				PROFILE_END(SCARD_E_TIMEOUT)
 				return SCARD_E_TIMEOUT;
 			}
 		}
@@ -2108,6 +2114,7 @@
 			BLOCK_STATUS_RESUME)
 	{
 		SYS_MutexUnLock(psContextMap[dwContextIndex].mMutex);
+		PROFILE_END(SCARD_E_CANCELLED)
 		return SCARD_E_CANCELLED;
 	}
 




More information about the Pcsclite-cvs-commit mailing list