Branch: refs/heads/master
Home: https://github.com/mono/gtk-sharp
Compare: https://github.com/mono/gtk-sharp/compare/21ef50ec48c8...68c64bedc05a
Commit: dcc2850a39c5fc317c199a0425856674dd1cc657
Author: Andrés G. Aragoneses <[email protected]> (knocte)
Date: 2013-10-28 20:57:29 GMT
URL: https://github.com/mono/gtk-sharp/commit/dcc2850a39c5fc317c199a0425856674dd1cc657
gui-thread-check: use fflush() after printf()
Using fflush() right away after printf() calls avoids the buffers to
be written in an apparently complete-out-of-sync way from the point
of view of the developer. This problem would specially occur when
redirecting all output to a file this way:
mono Foo.exe > out.txt 2>&1
Without this fix, all the output from gui-thread-check would appear
at the end of the file, instead of in between the output generated by
the program.
Cherry-picked from https://github.com/slluis/gui-thread-check/commit/6988cd4cd2deb21d0a8006d63e1090996f18b92f
Changed paths:
M gtk/gui-thread-check/profiler/gui-thread-check.c
Modified: gtk/gui-thread-check/profiler/gui-thread-check.c
===================================================================
@@ -26,6 +26,7 @@
#include <string.h>
#include <glib.h>
#include <mono/metadata/profiler.h>
+#include <stdio.h>
extern pthread_t pthread_self (void);
@@ -62,7 +63,8 @@
if (!guithread_set && strcmp (klass_name, "Application")==0 && strcmp (method_name, "Init")==0) {
guithread_set = TRUE;
guithread = current_thread_id;
- printf ("*** GUI THREAD INITIALIZED: %u\n", guithread);
+ printf ("*** GUI THREAD INITIALIZED: %u\n", guithread);
+ fflush (NULL);
return;
}
if (!guithread_set) {
@@ -77,6 +79,7 @@
) {
printf ("*** GTK CALL NOT IN GUI THREAD: %s.%s\n", klass_name, method_name);
mono_stack_walk_no_il (stack_walk_fn, NULL);
+ fflush (NULL);
}
}
}
Commit: 68c64bedc05a7a7ed2e4ed4732b775143b6554d7
Author: Lluis Sanchez <[email protected]> (slluis)
Date: 2013-10-30 18:14:21 GMT
URL: https://github.com/mono/gtk-sharp/commit/68c64bedc05a7a7ed2e4ed4732b775143b6554d7
Merge pull request #87 from knocte/guithreadcheck_fflush
gui-thread-check: use fflush() after printf()
Changed paths:
M gtk/gui-thread-check/profiler/gui-thread-check.c
Modified: gtk/gui-thread-check/profiler/gui-thread-check.c
===================================================================
@@ -26,6 +26,7 @@
#include <string.h>
#include <glib.h>
#include <mono/metadata/profiler.h>
+#include <stdio.h>
extern pthread_t pthread_self (void);
@@ -62,7 +63,8 @@
if (!guithread_set && strcmp (klass_name, "Application")==0 && strcmp (method_name, "Init")==0) {
guithread_set = TRUE;
guithread = current_thread_id;
- printf ("*** GUI THREAD INITIALIZED: %u\n", guithread);
+ printf ("*** GUI THREAD INITIALIZED: %u\n", guithread);
+ fflush (NULL);
return;
}
if (!guithread_set) {
@@ -77,6 +79,7 @@
) {
printf ("*** GTK CALL NOT IN GUI THREAD: %s.%s\n", klass_name, method_name);
mono_stack_walk_no_il (stack_walk_fn, NULL);
+ fflush (NULL);
}
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches
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.