CVS: winex/dlls/ntdll critsection.c,1.16,1.17

[email protected]
Newsgroups gmane.comp.emulators.winex.cvs
Message-ID <[email protected]>
Subject: winex/dlls/ntdll critsection.c,1.16,1.17Update of /var/lib/cvsd/cvsroot/winex/dlls/ntdll
In directory agravaine:/tmp/cvs-serv31175/dlls/ntdll

Modified Files:
	critsection.c 
Log Message:

- disable backtraces when creating critical sections, as they are not
useful as implemented and cause crashes on MacOS X


Index: critsection.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/dlls/ntdll/critsection.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- critsection.c	9 Jan 2006 18:27:15 -0000	1.16
+++ critsection.c	30 Mar 2007 15:55:17 -0000	1.17
@@ -22,6 +22,10 @@
 /* See http://msdn.microsoft.com/msdnmag/issues/03/12/CriticalSections/ for NT crit section
  * information */
 
+/* Disabled as they aren't useful as implemented (would be more useful if done
+   on locking a CS, although expensive), and they cause crashes on Apple */
+/* #define CS_BACKTRACES */
+
 /* PH: FIXME: Should autodetect */
 const BOOL multiprocessor = FALSE;
 
@@ -61,6 +65,7 @@
 
   fprintf( stderr, "csList(%p) = {Flink=%p, Blink=%p}\n", &csList, csList.Flink, csList.Blink );
 
+#ifdef CS_BACKTRACES
   for( lpList = csList.Flink; lpList != &csList;  lpList = lpList->Flink )
   {
     
@@ -87,6 +92,7 @@
     fprintf( stderr, "\t%p: crit=%p %s %s\n", debug, debug->CriticalSection, name, backtrace );
     fprintf( stderr, "\t%s\n", buf );
   }
+#endif /* CS_BACKTRACES */
 
   fprintf( stderr, "\tDone\n" );
 }
@@ -251,7 +257,9 @@
     crit->DebugInfo->EntryCount      = 0;
     crit->DebugInfo->ContentionCount = 0;
 
+#ifdef CS_BACKTRACES
     crit->DebugInfo->CreatorBackTraceIndex = CreateAndStoreBacktrace();
+#endif
 
     crit->DebugInfo->ProcessLocksList.Flink = &csList;
     crit->DebugInfo->ProcessLocksList.Blink = csList.Blink;
@@ -313,7 +321,9 @@
 
     info->Spare[0] = info->Spare[1] = 0;
 
+#ifdef CS_BACKTRACES
     ReleaseBacktrace( info->CreatorBackTraceIndex );
+#endif
     info->CreatorBackTraceIndex = 0;
 
     crit->DebugInfo = NULL;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.