glib worker: move to glib-private framework

Remove the private glib_get_worker_context() symbol and move it over to
using the glib-private stuff like GWakeup is doing.

https://bugzilla.gnome.org/show_bug.cgi?id=657992
This commit is contained in:
Ryan Lortie 2011-09-09 14:30:25 -04:00
parent 3022ef4731
commit d86386159d
4 changed files with 20 additions and 16 deletions

View File

@ -19,7 +19,6 @@
* Author: Colin Walters <walters@verbum.org>
*/
#include "gutils.h"
#include "glib-private.h"
/**
@ -37,9 +36,11 @@ glib__private__ (void)
g_wakeup_free,
g_wakeup_get_pollfd,
g_wakeup_signal,
g_wakeup_acknowledge
g_wakeup_acknowledge,
g_get_worker_context
};
return &table;
}

View File

@ -20,24 +20,28 @@
#ifndef __GLIB_PRIVATE_H__
#define __GLIB_PRIVATE_H__
#include <glib.h>
#include "gwakeup.h"
#include "gmain.h"
G_BEGIN_DECLS
G_GNUC_INTERNAL
GMainContext * g_get_worker_context (void);
#define GLIB_PRIVATE_CALL(symbol) (glib__private__()->symbol)
typedef struct {
/* See gwakeup.c */
GWakeup * (*g_wakeup_new) (void);
void (*g_wakeup_free) (GWakeup *wakeup);
void (*g_wakeup_get_pollfd) (GWakeup *wakeup,
GPollFD *poll_fd);
void (*g_wakeup_signal) (GWakeup *wakeup);
void (*g_wakeup_acknowledge) (GWakeup *wakeup);
GWakeup * (* g_wakeup_new) (void);
void (* g_wakeup_free) (GWakeup *wakeup);
void (* g_wakeup_get_pollfd) (GWakeup *wakeup,
GPollFD *poll_fd);
void (* g_wakeup_signal) (GWakeup *wakeup);
void (* g_wakeup_acknowledge) (GWakeup *wakeup);
/* Add other private functions here, initialize them in gutils.c */
/* See gmain.c */
GMainContext * (* g_get_worker_context) (void);
/* Add other private functions here, initialize them in glib-private.c */
} GLibPrivateVTable;
GLibPrivateVTable *glib__private__ (void);

View File

@ -1273,7 +1273,6 @@ g_utf16_to_ucs4
g_utf16_to_utf8
g_unichar_to_utf8
g_unichar_validate
glib_get_worker_context
glib_pgettext
glib_gettext
#ifdef G_OS_WIN32

View File

@ -98,7 +98,7 @@
#include "gwakeup.h"
#include "glibprivate.h"
#include "glib-private.h"
/**
* SECTION:main
@ -4250,7 +4250,7 @@ ensure_unix_signal_handler_installed_unlocked (int signum)
if (!initialized)
{
sigemptyset (&installed_signal_mask);
glib_get_worker_context ();
g_get_worker_context ();
initialized = TRUE;
}
@ -4754,7 +4754,7 @@ glib_worker_main (gpointer data)
}
GMainContext *
glib_get_worker_context (void)
g_get_worker_context (void)
{
static gsize initialised;