Commit Graph

10593 Commits

Author SHA1 Message Date
Matthias Clasen
011c0b488f Add some tests for mimeapps.list handling
These tests directly look at mimeapps.list to verify that
we make the expected changes to the database.
2011-09-09 23:44:41 -04:00
Matthias Clasen
66a1dfc84f Avoid some compiler warnings 2011-09-09 23:44:41 -04:00
Ryan Lortie
644ab6a7d3 Nix inaccurately named g_main_context_init_pipe()
...and fold its contents into g_main_context_new()
2011-09-09 22:33:33 -04:00
Ryan Lortie
1c8c408c51 gmain: get rid of poll_waiting
This variable, which is the cause of much grief, exists for two reasons:

  - ensuring the the wakeup pipe doesn't fill up

  - preventing the first poll() after adding a source from waking up
    immediately

The first point is no longer an issue with GWakeup.

The second point is addressed by using different logic: we only signal a
wakeup in the case that the context is currently acquired by a thread
that is not us.

As an added bonus, we can now implement g_main_context_wakeup() without
taking a lock.

https://bugzilla.gnome.org/show_bug.cgi?id=583511
https://bugzilla.gnome.org/show_bug.cgi?id=320888
2011-09-09 22:32:06 -04:00
Emmanuele Bassi
e15d5313af Add macros for GSourceFunc return values
The boolean values to be returned by a GSourceFunc are always ambiguous,
and even in case of experienced developers then can lead to confusion.

The Perl bindings for GLib have two simple constants, mapping to TRUE
and FALSE, that make the return values less confusing: G_SOURCE_CONTINUE
and G_SOURCE_REMOVE respectively.

https://bugzilla.gnome.org/show_bug.cgi?id=631413
2011-09-09 22:08:58 -04:00
Matthias Clasen
e5653c0050 Keep up with the standards
More choices, always better.
2011-09-09 20:37:09 -04:00
Ryan Lortie
066c7b8121 GRegex: fix thread-unsafe initialiser code 2011-09-09 19:54:06 -04:00
Ryan Lortie
f1494c156d Clean up l10n threading stuff
Remove the explicit thread initialisation functions for g_get_charset(),
g_get_filename_charsets() and g_get_language_names().

Add a lock around one remaining case of access to libcharset (the other
2 cases already have the lock).

Do a proper g_once_init_enter() style initialisation for the GLib
gettext functions.

https://bugzilla.gnome.org/show_bug.cgi?id=658683
2011-09-09 19:50:55 -04:00
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