gdk: Don't use GDK_THREADS_ENTER/LEAVE macros internally

These are just wrappers for the functions, and we want to
deprecate them. Stopping to use them internally is a good
first step.
This commit is contained in:
Matthias Clasen 2012-07-28 14:40:04 +02:00
parent f92a092bac
commit 144a5687c9
8 changed files with 34 additions and 32 deletions

View File

@ -58,12 +58,12 @@ gdk_event_source_prepare (GSource *source,
GdkDisplay *display = ((GdkEventSource*) source)->display;
gboolean retval;
GDK_THREADS_ENTER ();
gdk_threads_enter ();
*timeout = -1;
retval = (_gdk_event_queue_find_first (display) != NULL);
GDK_THREADS_LEAVE ();
gdk_threads_leave ();
return retval;
}
@ -74,14 +74,14 @@ gdk_event_source_check (GSource *source)
GdkEventSource *event_source = (GdkEventSource*) source;
gboolean retval;
GDK_THREADS_ENTER ();
gdk_threads_enter ();
if (event_source->event_poll_fd.revents & G_IO_IN)
retval = (_gdk_event_queue_find_first (event_source->display) != NULL);
else
retval = FALSE;
GDK_THREADS_LEAVE ();
gdk_threads_leave ();
return retval;
}
@ -353,7 +353,7 @@ gdk_event_source_dispatch (GSource *source,
GdkDisplay *display = ((GdkEventSource*) source)->display;
GdkEvent *event;
GDK_THREADS_ENTER ();
gdk_threads_enter ();
event = gdk_display_get_event (display);
@ -364,7 +364,7 @@ gdk_event_source_dispatch (GSource *source,
gdk_event_free (event);
}
GDK_THREADS_LEAVE ();
gdk_threads_leave ();
return TRUE;
}

View File

@ -24,6 +24,8 @@
#include "config.h"
#define GDK_DISABLE_DEPRECATION_WARNINGS 1
#include "gdkmain.h"
#include "gdkinternals.h"
@ -757,12 +759,12 @@ gdk_threads_dispatch (gpointer data)
GdkThreadsDispatch *dispatch = data;
gboolean ret = FALSE;
GDK_THREADS_ENTER ();
gdk_threads_enter ();
if (!g_source_is_destroyed (g_main_current_source ()))
ret = dispatch->func (dispatch->data);
GDK_THREADS_LEAVE ();
gdk_threads_leave ();
return ret;
}

View File

@ -616,14 +616,14 @@ gdk_event_prepare (GSource *source,
{
gboolean retval;
GDK_THREADS_ENTER ();
gdk_threads_enter ();
*timeout = -1;
retval = (_gdk_event_queue_find_first (_gdk_display) != NULL ||
_gdk_quartz_event_loop_check_pending ());
GDK_THREADS_LEAVE ();
gdk_threads_leave ();
return retval;
}
@ -633,7 +633,7 @@ gdk_event_check (GSource *source)
{
gboolean retval;
GDK_THREADS_ENTER ();
gdk_threads_enter ();
/* Refresh the autorelease pool if we're at the base CFRunLoop level
* (indicated by current_loop_level) and the base g_main_loop level
@ -653,7 +653,7 @@ gdk_event_check (GSource *source)
retval = (_gdk_event_queue_find_first (_gdk_display) != NULL ||
_gdk_quartz_event_loop_check_pending ());
GDK_THREADS_LEAVE ();
gdk_threads_leave ();
return retval;
}
@ -665,7 +665,7 @@ gdk_event_dispatch (GSource *source,
{
GdkEvent *event;
GDK_THREADS_ENTER ();
gdk_threads_enter ();
_gdk_quartz_display_queue_events (_gdk_display);
@ -678,7 +678,7 @@ gdk_event_dispatch (GSource *source,
gdk_event_free (event);
}
GDK_THREADS_LEAVE ();
gdk_threads_leave ();
return TRUE;
}

View File

@ -1478,9 +1478,9 @@ _gdk_quartz_display_queue_events (GdkDisplay *display)
g_list_free_1 (node);
gdk_event_free (event);
GDK_THREADS_LEAVE ();
gdk_threads_leave ();
[NSApp sendEvent:nsevent];
GDK_THREADS_ENTER ();
gdk_threads_enter ();
}
_gdk_quartz_event_loop_release_event (nsevent);

View File

@ -68,7 +68,7 @@ gdk_event_source_dispatch(GSource *base,
GdkDisplay *display = source->display;
GdkEvent *event;
GDK_THREADS_ENTER ();
gdk_threads_enter ();
event = gdk_display_get_event (display);
@ -79,7 +79,7 @@ gdk_event_source_dispatch(GSource *base,
gdk_event_free (event);
}
GDK_THREADS_LEAVE ();
gdk_threads_leave ();
return TRUE;
}

View File

@ -3326,7 +3326,7 @@ gdk_event_prepare (GSource *source,
{
gboolean retval;
GDK_THREADS_ENTER ();
gdk_threads_enter ();
*timeout = -1;
@ -3334,7 +3334,7 @@ gdk_event_prepare (GSource *source,
(modal_win32_dialog == NULL &&
GetQueueStatus (QS_ALLINPUT) != 0));
GDK_THREADS_LEAVE ();
gdk_threads_leave ();
return retval;
}
@ -3344,7 +3344,7 @@ gdk_event_check (GSource *source)
{
gboolean retval;
GDK_THREADS_ENTER ();
gdk_threads_enter ();
if (event_poll_fd.revents & G_IO_IN)
{
@ -3357,7 +3357,7 @@ gdk_event_check (GSource *source)
retval = FALSE;
}
GDK_THREADS_LEAVE ();
gdk_threads_leave ();
return retval;
}
@ -3369,7 +3369,7 @@ gdk_event_dispatch (GSource *source,
{
GdkEvent *event;
GDK_THREADS_ENTER ();
gdk_threads_enter ();
_gdk_win32_display_queue_events (_gdk_display);
event = _gdk_event_unqueue (_gdk_display);
@ -3389,7 +3389,7 @@ gdk_event_dispatch (GSource *source,
}
}
GDK_THREADS_LEAVE ();
gdk_threads_leave ();
return TRUE;
}

View File

@ -1483,11 +1483,11 @@ process_internal_connection (GIOChannel *gioc,
{
GdkInternalConnection *connection = (GdkInternalConnection *)data;
GDK_THREADS_ENTER ();
gdk_threads_enter ();
XProcessInternalConnection ((Display*)connection->display, connection->fd);
GDK_THREADS_LEAVE ();
gdk_threads_leave ();
return TRUE;
}

View File

@ -273,13 +273,13 @@ gdk_event_source_prepare (GSource *source,
GdkDisplay *display = ((GdkEventSource*) source)->display;
gboolean retval;
GDK_THREADS_ENTER ();
gdk_threads_enter ();
*timeout = -1;
retval = (_gdk_event_queue_find_first (display) != NULL ||
gdk_check_xpending (display));
GDK_THREADS_LEAVE ();
gdk_threads_leave ();
return retval;
}
@ -290,7 +290,7 @@ gdk_event_source_check (GSource *source)
GdkEventSource *event_source = (GdkEventSource*) source;
gboolean retval;
GDK_THREADS_ENTER ();
gdk_threads_enter ();
if (event_source->event_poll_fd.revents & G_IO_IN)
retval = (_gdk_event_queue_find_first (event_source->display) != NULL ||
@ -298,7 +298,7 @@ gdk_event_source_check (GSource *source)
else
retval = FALSE;
GDK_THREADS_LEAVE ();
gdk_threads_leave ();
return retval;
}
@ -349,7 +349,7 @@ gdk_event_source_dispatch (GSource *source,
GdkDisplay *display = ((GdkEventSource*) source)->display;
GdkEvent *event;
GDK_THREADS_ENTER ();
gdk_threads_enter ();
event = gdk_display_get_event (display);
@ -360,7 +360,7 @@ gdk_event_source_dispatch (GSource *source,
gdk_event_free (event);
}
GDK_THREADS_LEAVE ();
gdk_threads_leave ();
return TRUE;
}