mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-11-12 13:52:55 +01:00
Add some mainloop instrumentation
Add trace points around adding, removing and dispatching of sources. https://bugzilla.gnome.org/show_bug.cgi?id=710741
This commit is contained in:
@@ -73,6 +73,8 @@
|
||||
#include <windows.h>
|
||||
#endif /* G_OS_WIN32 */
|
||||
|
||||
#include "glib_trace.h"
|
||||
|
||||
#include "gmain.h"
|
||||
|
||||
#include "garray.h"
|
||||
@@ -1165,6 +1167,8 @@ g_source_attach (GSource *source,
|
||||
g_return_val_if_fail (source->context == NULL, 0);
|
||||
g_return_val_if_fail (!SOURCE_DESTROYED (source), 0);
|
||||
|
||||
TRACE (GLIB_MAIN_SOURCE_ATTACH (g_source_get_name (source)));
|
||||
|
||||
if (!context)
|
||||
context = g_main_context_default ();
|
||||
|
||||
@@ -1182,6 +1186,8 @@ g_source_destroy_internal (GSource *source,
|
||||
GMainContext *context,
|
||||
gboolean have_lock)
|
||||
{
|
||||
TRACE (GLIB_MAIN_SOURCE_DESTROY (g_source_get_name (source)));
|
||||
|
||||
if (!have_lock)
|
||||
LOCK_CONTEXT (context);
|
||||
|
||||
@@ -3058,7 +3064,9 @@ g_main_dispatch (GMainContext *context)
|
||||
current->source = source;
|
||||
current->depth++;
|
||||
|
||||
TRACE( GLIB_MAIN_BEFORE_DISPATCH (g_source_get_name (source)));
|
||||
need_destroy = !(* dispatch) (source, callback, user_data);
|
||||
TRACE( GLIB_MAIN_AFTER_DISPATCH (g_source_get_name (source)));
|
||||
|
||||
current->source = prev_source;
|
||||
current->depth--;
|
||||
|
||||
Reference in New Issue
Block a user