[rkward-cvs] SF.net SVN: rkward:[3147] branches/2010_10_18_backend_restructuring_branch/ rkward/main.cpp

tfry at users.sourceforge.net tfry at users.sourceforge.net
Mon Oct 25 16:29:10 UTC 2010


Revision: 3147
          http://rkward.svn.sourceforge.net/rkward/?rev=3147&view=rev
Author:   tfry
Date:     2010-10-25 16:29:10 +0000 (Mon, 25 Oct 2010)

Log Message:
-----------
our debug messages were not thread-safe

Modified Paths:
--------------
    branches/2010_10_18_backend_restructuring_branch/rkward/main.cpp

Modified: branches/2010_10_18_backend_restructuring_branch/rkward/main.cpp
===================================================================
--- branches/2010_10_18_backend_restructuring_branch/rkward/main.cpp	2010-10-25 16:28:20 UTC (rev 3146)
+++ branches/2010_10_18_backend_restructuring_branch/rkward/main.cpp	2010-10-25 16:29:10 UTC (rev 3147)
@@ -56,6 +56,7 @@
 #include <ktemporaryfile.h>
 
 #include <qstring.h>
+#include <QMutex>
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -77,16 +78,19 @@
 int RK_Debug_Level = 0;
 int RK_Debug_Flags = ALL;
 int RK_Debug_CommandStep = 0;
+QMutex RK_Debug_Mutex;
 
 static KCmdLineOptions options;
 
 void RKDebugMessageOutput (QtMsgType type, const char *msg) {
+	RK_Debug_Mutex.lock ();
 	if (type == QtFatalMsg) {
 		fprintf (stderr, "%s\n", msg);
 	}
 	RKSettingsModuleDebug::debug_file->write (msg);
 	RKSettingsModuleDebug::debug_file->write ("\n");
 	RKSettingsModuleDebug::debug_file->flush ();
+	RK_Debug_Mutex.unlock ();
 }
 
 int main(int argc, char *argv[]) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list