Commit Graph

10785 Commits

Author SHA1 Message Date
Ryan Lortie
bceaf3a719 glib-private: #include <glib.h>
This is really our only choice if we don't want to annoy the
single-include checking when we use this from inside of gio.
2011-09-09 16:05:55 -04:00
Ryan Lortie
e27b5a2ea7 Drop long-removed atomic thread init from header 2011-09-09 15:47:01 -04:00
Ryan Lortie
9e1d4aa257 Remove now-useless glibprivate.h
The only symbol in glibprivate.h was moved to glib-private.h.
2011-09-09 15:21:07 -04:00
Ryan Lortie
d86386159d 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
2011-09-09 14:32:00 -04:00
Ryan Lortie
3022ef4731 gwakeup.h: add missing header for GPollFD 2011-09-09 14:30:01 -04:00
Colin Walters
9bf59d4a14 Add glib__private__() API to share between glib,gio; port GWakeup to it
Historically we've added random symbols to the public API with warnings
that they're private; examples are:

glib_gettext(), glib_pgettext()
g_thread_functions_for_glib_use, g_thread_use_default_impl, etc.

And we almost added "GWakeup" to public API just to share between glib and
gio.

This new glib__private__() API exports a hidden vtable, and adds a macro
GLIB_PRIVATE_CALL() that makes it generally convenient to use.

This adds an extremely tiny cost for the double indirection; but it has
the benefit that we don't need to either:

1) compile the code into both glib and gio (like GWakeup), with the
   inefficiency that implies.
2) Export a "do not use this" symbol; the serious problem with this is
   that someone CAN use it pretty easily.  Particularly if we document
   it.  It's far, far harder to peek into a structure without a public
   header file.

https://bugzilla.gnome.org/show_bug.cgi?id=657992
2011-09-09 14:17:08 -04:00
Ryan Lortie
b891b3616f GMainLoop: remove wall clock time cache
Since GMainLoop is now purely monotonic, it really doesn't make sense to
cache the wallclock time just for the sake of making a deprecated call
more efficient.
2011-09-09 13:41:36 -04:00
Ryan Lortie
940a728fda gtester: Remove SIGCHLD race workarounds
With the GMainLoop changes, gtester should now be race-free.
2011-09-09 13:41:27 -04:00
Ryan Lortie
ba7019e19e Modify child and signal sources to use worker 2011-09-09 13:41:27 -04:00
Ryan Lortie
7eae486179 GMain: simplify logic for g_wakeup_acknowledge()
Instead of messing around with context->poll_waiting, just look at the
GPollFD to see if the GWakeup needs to be acknowledged.
2011-09-09 13:41:27 -04:00
Ryan Lortie
87880dfa57 GMainLoop: remove single-threaded case
Since we now always have thread support in libglib, we can remove the
buggy single-threaded codepath for GMainContext.
2011-09-09 13:41:27 -04:00
Ryan Lortie
1facd36d00 Add private glib_get_worker_context() API
The first time this is called, this creates a GMainContext * and a
thread to run it.  Future calls return the same.  There are a lot of
places that we could use this in GLib.
2011-09-09 13:40:50 -04:00
Ryan Lortie
b6a2f502f2 GRand: Make sure to g_thread_init_glib()
The last commit should g_thread_init_glib() before attempting to use
GOnce.
2011-09-09 13:39:22 -04:00
Ryan Lortie
71c72d5e13 GRand: remove setup from g_thread_init_glib
Use g_once_init_enter instead.
2011-09-09 13:31:21 -04:00
Ryan Lortie
413186a962 emufutex: remove init from g_thread_init_glib
Use a GStaticMutex instead.
2011-09-09 13:23:48 -04:00
Ryan Lortie
80109acef5 win32: remove version init from g_thread_init_glib
Instead, make this use g_once_init_enter() in the usual way.
2011-09-09 13:17:42 -04:00
Ryan Lortie
6c0dda8265 make g_thread_init_glib() idempotent 2011-09-09 12:47:40 -04:00
Ryan Lortie
cfa1d0540e Move the GThread implementations to glib/
We can now get threads initialised from inside of libglib by calling
g_thread_init_glib().
2011-09-09 12:47:40 -04:00
Ryan Lortie
96e4896804 invert gthread-impl includes
configure.ac defined G_THREAD_SOURCE and gthread-impl would #include it.

Instead, since we only have two thread implementations now, and since we
always use the Windows one only on Windows, move the logic to the
Makefile, predicated on 'if OS_WIN32'.  Then have the chosen backend do
the #include "gthread-impl.c" from there.

Remove the G_THREAD_SOURCE define from configure.ac.
2011-09-09 12:47:40 -04:00
Ryan Lortie
fc6a9275a4 win32 threads: assume TryEnterCriticalSection
Remove the dynamic lookup for TryEnterCriticalSection, which has existed
since Windows 2000.
2011-09-09 12:47:40 -04:00
Ryan Lortie
7cf89847e2 Stop using HAVE_G_THREAD_IMPL_INIT
Just always call the init function.
2011-09-09 12:47:40 -04:00
Ryan Lortie
46af418e05 Move thread priority translation into the backends
The translation of GLib priorities into the thread priorities of
different operating systems belongs in the implementation -- not
half-way in the front end.
2011-09-09 12:47:40 -04:00
Ryan Lortie
a4777122c8 Remove useless macros from when we supported DCE
These are non-ops now, and easily replaced.
2011-09-09 12:47:40 -04:00
Ryan Lortie
715f94e951 Remove support for DCE threads 2011-09-09 12:47:40 -04:00
Ryan Lortie
7d885253fa Remove support for custom thread implementations 2011-09-09 12:47:39 -04:00
Ryan Lortie
cef0acb945 Remove the dead 'none' thread implementation 2011-09-09 12:47:39 -04:00
Ryan Lortie
3f93141243 GThread: remove errorcheck mutex support
This can only possibly work if we call g_thread_init(), which we are
moving away from.
2011-09-09 12:47:39 -04:00
Ryan Lortie
41cbb40dca gthread: remove some unused forward declarations 2011-09-09 12:47:39 -04:00
Ryan Lortie
e48573c402 Deprecated (undocumented) g_thread_gettime
g_thread_gettime() is an undocumented public function pointer that
points to a function that returns the monotonic time in nanoseconds.
g_get_monotonic_time() does the same in microseconds, so it can be used
instead.

GLib had one internal user in GFileMonitor that only cared about
millisecond accuracy; it has been ported to g_get_monotonic_time().
2011-09-09 12:47:39 -04:00
Ryan Lortie
3534ff418c Update building docs to mention mandatory threads
The docs used to say thread support was optional -- it's mandatory now.
2011-09-09 12:47:39 -04:00
Dan Winship
5a30712dc7 Remove !g_thread_supported() codepaths in gio
In particular, remove the libasyncns import, which was only used by
GUnixResolver, which is only used when threads are not available.
Likewise remove GWin32Resolver, and the hacky broken non-threaded
parts of GIOScheduler.

https://bugzilla.gnome.org/show_bug.cgi?id=616754
2011-09-09 12:47:39 -04:00
Ryan Lortie
aa586f6354 Revert "GIOSchedulerJob: Improve struct packing"
This reverts commit a2094d5e56.

https://bugzilla.gnome.org/show_bug.cgi?id=616754
2011-09-09 12:41:56 -04:00
Dan Winship
5bc7729d16 Make threads mandatory
G_THREADS_ENABLED still exists, but is always defined. It is still
possible to use libglib without threads, but gobject (and everything
above it) is now guaranteed to be using threads (as, in fact, it was
before, since it was accidentally impossible to compile with
--disable-threads).

https://bugzilla.gnome.org/show_bug.cgi?id=616754
2011-09-09 12:41:55 -04:00
David Schleef
0d1a2eb4bf Fix spelling of G_IO_FLAG_IS_WRITEABLE
Fixes #657045.
2011-09-08 20:22:42 -04:00
Kushal Das
7a45dde4fe g_key_file_parse_value_as_integer: Integers can have trailing whitespaces or tabs
Now it can parse integer values with trailing whitespaces or tabs before CR.
Using g_ascii_isspace() as suggested.

https://bugzilla.gnome.org/show_bug.cgi?id=653987
2011-09-08 20:20:02 -04:00
Piotr Drąg
4a1d79842a Updated Polish translation 2011-09-08 21:08:09 +02:00
Piotr Drąg
687144edc7 Updated Polish translation 2011-09-08 20:44:19 +02:00
Damien Lespiau
c8ef5b7d6c simpleaction: Fix documentation of :enabled
An over-zealous sed, most likely, transformed g_action_.*() into
g_simple_action.*().

https://bugzilla.gnome.org/show_bug.cgi?id=658558
2011-09-08 17:07:56 +01:00
Alexandre Franke
e03b70c4a2 Update French translation 2011-09-08 17:32:18 +02:00
Federico Mena Quintero
571185f0f6 bgo#640212 - Replace "error stating file" with friendlier messages
Non-technical users won't know that "stating" refers to stat(2), so we
just use "error when getting information" now.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-09-08 09:11:56 -05:00
Bruce Cowan
62a648953b Updated British English translation 2011-09-07 17:00:06 +01:00
Luca Ferretti
b95237ba53 Updated Italian translation 2011-09-07 00:34:02 +02:00
Ihar Hrachyshka
ef0f90a017 Updated Belarusian translation. 2011-09-07 01:29:04 +03:00
Kjartan Maraas
cfe04105f4 Added Norwegian bokmål translation 2011-09-06 21:49:06 +02:00
Ryan Lortie
27fbaf3712 GSettingsBackend: emit changes to correct thread
When g_settings_apply() is called on a delayed settings backend and
there is a D-Bus error when communicating with dconf-service, recent
versions of the dconf GSettingsBackend call a function in GLib that
improperly delivered the signal directly instead of using
g_main_context_invoke().

This patch fixes this function to route in the same way as the others so
that the signal is dispatched in the proper GMainContext.
2011-09-06 14:07:16 -04:00
Ryan Lortie
8060a7a207 'master' is now glib 2.31.0 2011-09-06 10:55:09 -04:00
Ryan Lortie
9d6b55499f glib 2.29.90 2011-09-06 10:08:34 -04:00
Andika Triwidada
6f6c924b08 Updated Indonesian translation 2011-09-06 16:50:11 +07:00
Ryan Lortie
8a7d33024a gio docs: lots more fixes 2011-09-06 00:31:49 -04:00
Ryan Lortie
e88d735787 gio docs: only include GTlsInteraction once
It was included twice in the gio-docs.xml file.
2011-09-06 00:01:29 -04:00