Ryan Lortie [Thu, 13 Oct 2011 01:47:25 +0000 (21:47 -0400)]
thread: stop sharing g_once_mutex
Unrelated code shouldn't be sharing the same mutex for no good reason --
particularly not across a file boundary.
Ryan Lortie [Thu, 13 Oct 2011 01:44:07 +0000 (21:44 -0400)]
thread: drop thread setup function hackery
Use a custom proxy function for the deprecated case instead.
Now GRealThread has strictly zero members dedicated to deprecated
functionality.
Matthias Clasen [Wed, 12 Oct 2011 23:55:02 +0000 (19:55 -0400)]
Deprecate GCache
Ryan said it would be 'deprecated soon in GLib', when he removed
the use of this in GTK+. That was a year ago, so its about time
we act on it.
Ryan Lortie [Wed, 12 Oct 2011 22:35:45 +0000 (18:35 -0400)]
thread: Delete g_system_thread_self()
It's no longer used for anything at all.
Ryan Lortie [Wed, 12 Oct 2011 22:33:07 +0000 (18:33 -0400)]
thread: reduce use of system_thread
The use of system_thread is now limited to joining. We don't do that
for threads that we didn't create for ourselves, so we don't need to
call g_system_thread_self() to fill in system_thread for those.
Ryan Lortie [Wed, 12 Oct 2011 22:27:06 +0000 (18:27 -0400)]
thread: hide g_static_rec_mutex_get_rec_mutex_impl
Unlike with GStaticMutex, this function was never part of the pre-2.32
ABI, so we should keep it tucked in.
Ryan Lortie [Wed, 12 Oct 2011 22:25:40 +0000 (18:25 -0400)]
missed from last commit
Ryan Lortie [Wed, 12 Oct 2011 22:24:48 +0000 (18:24 -0400)]
thread: remove GSystemThread assign/equal
These are no longer in use.
Ryan Lortie [Wed, 12 Oct 2011 22:23:20 +0000 (18:23 -0400)]
thread: remove dead decl from gthreadprivate.h
This function hasn't existed for a while...
Ryan Lortie [Wed, 12 Oct 2011 22:22:31 +0000 (18:22 -0400)]
thread: Remove the zero_thread
This was only used for redundant assertion checks.
Ryan Lortie [Tue, 11 Oct 2011 15:08:48 +0000 (11:08 -0400)]
GStaticRecMutex: implement via GRecMutex
Instead of doing our own hacked-up version.
This also reduces use of GSystemThread.
Ryan Lortie [Wed, 12 Oct 2011 21:01:33 +0000 (17:01 -0400)]
thread: use GSList for g_thread_foreach list
...instead of having a 'next' pointer in the GThread struct.
Now GThread contains no fields used only by deprecated code (except for
the rather generic setup function field).
Ryan Lortie [Wed, 12 Oct 2011 20:50:43 +0000 (16:50 -0400)]
thread: call g_enumerable_thread_add via callback
There are no longer any functions defined in gthread-deprecated.c called
from gthread.c.
Ryan Lortie [Wed, 12 Oct 2011 20:26:39 +0000 (16:26 -0400)]
thread: use GPrivate for enumerable threads
Use a GPrivate to track the destruction of enumerable threads and remove
them from the list.
Colin Walters [Wed, 12 Oct 2011 19:25:12 +0000 (15:25 -0400)]
gvariant: Doc typo fix
Colin Walters [Wed, 12 Oct 2011 19:22:09 +0000 (15:22 -0400)]
gvariant: Briefly mention limits
Dan Winship [Wed, 12 Oct 2011 17:59:33 +0000 (13:59 -0400)]
gthread-deprecated: add a mising "static" to a method
Dan Winship [Wed, 12 Oct 2011 17:57:44 +0000 (13:57 -0400)]
giomodule: make the default_modules mutex recursive
It is possible for _g_io_module_get_default() to be called recursively
(eg, if a module of one type is loaded that tries to look up gsettings
from its init() method and ends up causing the gsettings module to be
loaded). So use a recursive mutex.
Dan Winship [Tue, 11 Oct 2011 19:38:37 +0000 (15:38 -0400)]
Simplify checks for CLOCK_MONOTONIC
Remove the complicated configure-time and runtime checks, and just use
CLOCK_MONOTONIC if it's defined.
https://bugzilla.gnome.org/show_bug.cgi?id=661421
Matthias Clasen [Wed, 12 Oct 2011 04:37:02 +0000 (00:37 -0400)]
Disable deprecations where appropriate in tests
Matthias Clasen [Wed, 12 Oct 2011 04:37:02 +0000 (00:37 -0400)]
Disable deprecations where appropriate in tests
Matthias Clasen [Wed, 12 Oct 2011 04:24:46 +0000 (00:24 -0400)]
Make single includes mandatory
This has been the official line since 2.17, which seems plenty
long enough for a transition phase.
Ryan Lortie [Wed, 12 Oct 2011 03:13:22 +0000 (23:13 -0400)]
GStaticPrivate: implement via GPrivate
Thanks to the modifications in
3d4846d92309d001697c2827660fa41b5c63dbc4,
GStaticPrivate is not so directly tied in with GThread anymore. It is
now a simple matter to cut it out completely by using a GPrivate to
store the GArray instead of storing it in the GThread.
Matthias Clasen [Wed, 12 Oct 2011 03:50:34 +0000 (23:50 -0400)]
Update deprecation docs
Matthias Clasen [Wed, 12 Oct 2011 03:44:43 +0000 (23:44 -0400)]
Silence deprecations in deprecated/ (again)
Chun-wei Fan [Wed, 12 Oct 2011 03:23:49 +0000 (11:23 +0800)]
Update VS projects
Get rid of _CRT_SECURE_NO_WARNINGS and _CRT_NONSTDC_NO_WARNINGS
from the preprocessor definitions as those two macros are now defined
in msvc_recommended_pragmas.h, which is force-included in these projects
via the property sheets. This will silence C4005 warnings on macro
redefinition.
Chun-wei Fan [Wed, 12 Oct 2011 02:53:30 +0000 (10:53 +0800)]
Bug 661438: Update msvc_recommended_pragmas.h
Don't disable warning C4996 as that is the Visual C++ warning triggered by
__declspec(deprecated) and __declspec(deprecated('..."))-disabling that
warning will defeat the purpose of G_DPRECATED/G_DEPRECATED_FOR.
For people who don't want to see the GLib deprecation warnings during GLib
compilation, define GLIB_DISABLE_DEPRECATION_WARNINGS in the projects or
property sheet.
Chun-wei Fan [Wed, 12 Oct 2011 02:38:47 +0000 (10:38 +0800)]
Bug 661438: Fix up gmacros.h a bit
The macro here should be G_DEPRECATED, not G_GNUC_DEPRECATED.
Chun-wei Fan [Wed, 12 Oct 2011 02:37:24 +0000 (10:37 +0800)]
Update VS property sheets
Missed the new glib/gstringchunk.h header that needed to be installed as
well.
Dan Winship [Tue, 11 Oct 2011 23:28:59 +0000 (19:28 -0400)]
g_time_val_from_iso8601: clarify the docs a bit
Ryan Lortie [Tue, 11 Oct 2011 22:39:57 +0000 (18:39 -0400)]
gmain: use GPrivate instead of GStaticPrivate
Dan Winship [Tue, 11 Oct 2011 19:36:42 +0000 (15:36 -0400)]
Fix two tests for G_DEBUG=gc-friendly
Chun-wei Fan [Tue, 11 Oct 2011 06:34:59 +0000 (14:34 +0800)]
Use GLIB_DEPRECATED instead of G_GNUC_DEPRECATED in our headers
This will let others opt out of seeing GLib deprecation warnings
by defining GLIB_DISABLE_DEPRECATION_WARNINGS.
https://bugzilla.gnome.org/show_bug.cgi?id=661438
Matthias Clasen [Tue, 11 Oct 2011 17:33:07 +0000 (13:33 -0400)]
Add our own deprecation macros
This will allow to suppress deprecation warnings on a per-module
basis, if needed. They are on by default now, though.
Matthias Clasen [Tue, 11 Oct 2011 17:06:58 +0000 (13:06 -0400)]
Add better deprecation macros
Unlike G_GNUC_... macros, the new G_DEPRECATED[_FOR] are
meant as abstractions that work with different compilers.
Using a new name also lets us restrict it to 'must be placed
before the declaration', which works with more compilers.
https://bugzilla.gnome.org/show_bug.cgi?id=661438
Chun-wei Fan [Tue, 11 Oct 2011 10:04:07 +0000 (18:04 +0800)]
Update VS property sheets
Copy the deprecated headers in their appropriate places.
Chun-wei Fan [Tue, 11 Oct 2011 06:19:02 +0000 (14:19 +0800)]
glibconfig.win32(.in): Cleanup cruft
The definitions of _GMutex* and G_STATIC_MUTEX_INIT is now found in
glib/deprecated/gthread.h, and should no longer be in the mainline
code, so remove them from here.
Ryan Lortie [Mon, 10 Oct 2011 17:13:31 +0000 (13:13 -0400)]
GStaticMutex: ABI fixup
Everything was OK as long as GMutex was backed by pthread_mutex_t on
POSIX. Since this is no longer the case, the ABI of GStaticMutex was
broken.
Fix that up by using pthread_mutex_t directly in the structure. Since
that's potentially incompatible with our GMutex implementation, set
g_thread_use_default_impl to FALSE to cause the fallback code (which
manually allocates a GMutex) to run, even in the case of
already-existing code (without the need for a recompile). This will
cause the pthread_mutex_t part of the struct to be completely ignored.
Matthias Clasen [Mon, 10 Oct 2011 15:10:20 +0000 (11:10 -0400)]
Compile private test with -pthread on UNIX
We are using explicit pthread calls here, so we should
use the right linker flags for that.
https://bugzilla.gnome.org/show_bug.cgi?id=661318
Matthias Clasen [Mon, 10 Oct 2011 13:49:50 +0000 (09:49 -0400)]
Don't use deprecated GThread API in gio tests
Kjartan Maraas [Mon, 10 Oct 2011 05:53:16 +0000 (07:53 +0200)]
Updated Norwegian bokmål translation
Algimantas Margevičius [Sun, 9 Oct 2011 19:00:49 +0000 (22:00 +0300)]
Updated Lithuanian translation
Matthias Clasen [Sun, 9 Oct 2011 13:57:13 +0000 (09:57 -0400)]
Silence deprecation warnings in deprecated/
We know we are all deprecated here...
Matthias Clasen [Sun, 9 Oct 2011 03:49:04 +0000 (23:49 -0400)]
Add G_GNUC_DEPRECATED to deprecated functions in gio
Matthias Clasen [Sun, 9 Oct 2011 03:23:43 +0000 (23:23 -0400)]
Add G_GNUC_DEPRECATED to deprecated functions in gobject
Matthias Clasen [Sun, 9 Oct 2011 03:16:01 +0000 (23:16 -0400)]
Add G_GNUC_DEPRECATED to deprecated APIs in glib
Matthias Clasen [Sat, 8 Oct 2011 16:43:12 +0000 (12:43 -0400)]
Add some GHookList tests
Matthias Clasen [Sat, 8 Oct 2011 16:42:41 +0000 (12:42 -0400)]
Test a few more GIOChannel functions
Matthias Clasen [Sat, 8 Oct 2011 16:42:06 +0000 (12:42 -0400)]
Remove a bit of dead code
Matthias Clasen [Sat, 8 Oct 2011 16:41:38 +0000 (12:41 -0400)]
Pass G_DEBUG=g-gc-friendly when running the tests
Matthias Clasen [Thu, 6 Oct 2011 13:01:24 +0000 (09:01 -0400)]
Add some more GMarkup tests
Matthias Clasen [Thu, 6 Oct 2011 12:59:51 +0000 (08:59 -0400)]
Call setlocale in markup-parse test
This is necessary to make utf-8 text come out properly.
Matthias Clasen [Thu, 6 Oct 2011 03:36:35 +0000 (23:36 -0400)]
Improve GNode test coverage
Matthias Clasen [Thu, 6 Oct 2011 03:31:14 +0000 (23:31 -0400)]
Improve GCache test coverage
Matthias Clasen [Thu, 6 Oct 2011 03:24:27 +0000 (23:24 -0400)]
Improve coverage of string function tests
Matthias Clasen [Thu, 6 Oct 2011 03:24:08 +0000 (23:24 -0400)]
Improve coverage of GHmac tests
Matthias Clasen [Thu, 6 Oct 2011 03:00:09 +0000 (23:00 -0400)]
Add a test for g_date_time_new_from_timeval_utc
Antoine Jacoutot [Sat, 8 Oct 2011 09:47:20 +0000 (11:47 +0200)]
gio: enable test_peer regression test for OpenBSD
https://bugzilla.gnome.org/show_bug.cgi?id=661255
David Zeuthen [Fri, 7 Oct 2011 18:20:03 +0000 (14:20 -0400)]
GDBusConnection: Make pending calls error when the connection is lost
If the connection to the bus is lost while a method call is ongoing,
the method call does not get cancelled. Instead it just sits around
until it times out.
This is visible here on XO laptops when stopping the display manager
during shutdown. imsettings starts sending a sync message to give up
its bus name (via g_bus_unown_name()), then systemd terminates the
session bus at approximately the same time. imsettings then hangs for
about 20 seconds before timing out the message.
http://lists.freedesktop.org/archives/dbus/2011-September/014717.html
imsettings behaviour could be improved as described in that thread,
but I think this is a glib bug. I've also come up with the attached
patch which fixes it.
Credits for the bug-fix goes to Daniel Drake <dsd@laptop.org>. The test
case was written by David Zeuthen <zeuthen@gmail.com>.
https://bugzilla.gnome.org/show_bug.cgi?id=660637
Signed-off-by: David Zeuthen <davidz@redhat.com>
John Ralls [Fri, 7 Oct 2011 16:51:04 +0000 (09:51 -0700)]
Bug 661129: Duplicate symbols zero_thread and g_once_mutex on OSX
Dan Winship [Wed, 5 Oct 2011 14:46:57 +0000 (10:46 -0400)]
Add g_main_context_ref_thread_default()
Add g_main_context_ref_thread_default(), which always returns a
reffed GMainContext, rather than sometimes returning a (non-reffed)
GMainContext, and sometimes returning NULL. This simplifies the
bookkeeping in any code that needs to keep a reference to the
thread-default context for a while.
https://bugzilla.gnome.org/show_bug.cgi?id=660994
Daniel Mustieles [Fri, 7 Oct 2011 08:14:10 +0000 (10:14 +0200)]
Updated Spanish translation
Matthias Clasen [Fri, 7 Oct 2011 05:19:15 +0000 (01:19 -0400)]
USE __COUNTER__ instead of __LINE__ when available
I've seen builds fail with
nm-connection.c:119:691: error: declaration of '_GStaticAssertCompileTimeAssertion_119' shadows a previous local [-Werror=shadow]
because several compile-time assertions ended up on the same
line. __COUNTER__ is meant specifically for the purpose of
constructing identifiers, so use it when available.
Matthias Clasen [Fri, 7 Oct 2011 04:42:52 +0000 (00:42 -0400)]
Don't redundantly redeclare
It makes gcc throw an error:
redundant redeclaration of 'g_static_mutex_get_mutex_impl' [-Werror=redundant-decls]
Ryan Lortie [Thu, 6 Oct 2011 16:24:21 +0000 (12:24 -0400)]
Move G_LOCK below GMutex in the docs
The flow is currently a bit wrong since G_LOCK makes reference to GMutex
which was not yet defined, so switch things around.
Ryan Lortie [Thu, 6 Oct 2011 16:21:33 +0000 (12:21 -0400)]
.gitignore
Ryan Lortie [Thu, 6 Oct 2011 16:19:58 +0000 (12:19 -0400)]
Several docs cleanups
Ryan Lortie [Thu, 6 Oct 2011 16:01:53 +0000 (12:01 -0400)]
Cleanup thread documentation
Chun-wei Fan [Thu, 6 Oct 2011 08:02:18 +0000 (16:02 +0800)]
gobjet/gclosure.c: Fix styling issues
...so that it looks more consistent with the rest.
Chun-wei Fan [Thu, 6 Oct 2011 07:37:52 +0000 (15:37 +0800)]
gobject/gclosure.c: Add type cast for int_val = value
This will silence compiler warnings on Visual C++.
(Sorry for the bad fix just now.)
Chun-wei Fan [Thu, 6 Oct 2011 07:33:34 +0000 (15:33 +0800)]
Revert "gobject/gclosure.c: Made up for missed pointer deref"
This reverts commit
d792a1ebe445cfab942ee9e079daa3b87bd60304.
Chun-wei Fan [Thu, 6 Oct 2011 07:24:08 +0000 (15:24 +0800)]
gobject/gclosure.c: Made up for missed pointer deref
The value parameter is a gpointer * (void **), but ffi_arg itself is not a
pointer type, so make up for dereference here.
Chun-wei Fan [Thu, 6 Oct 2011 07:12:22 +0000 (15:12 +0800)]
gthread-deprecated.c: Include gutils.h
This is needed for declaration of inline.
Chun-wei Fan [Thu, 6 Oct 2011 07:02:54 +0000 (15:02 +0800)]
config.h.win32(.in): Update for strcasecmp
Visual C++ uses _stricmp, which is identical to strcasecmp on gcc.
Matthias Clasen [Thu, 6 Oct 2011 02:43:22 +0000 (22:43 -0400)]
Update threads docs for the demise of g_thread_init()
Matthias Clasen [Thu, 6 Oct 2011 02:31:17 +0000 (22:31 -0400)]
Remove mention of gthread-2.0.pc from 'Compiling' section
At the same time, add one or two other corrections.
Matthias Clasen [Thu, 6 Oct 2011 02:23:25 +0000 (22:23 -0400)]
Add a warning to g_thread_init_with_errorcheck_mutexes
Should anybody try to use this, we should at least tell them that
its gone.
Dan Williams [Fri, 23 Sep 2011 17:32:23 +0000 (12:32 -0500)]
closure: fix handling of ENUMs and integral return types on 64-bit BE platforms
enums are stored in v_long but need to be marshalled as signed
integers. On platforms where int is 32 bits, taking the
address of v_long resulted in the wrong 32 bits being marshalled.
So we need to stuff the enum's int-sized value to a temporary
int-sized variable and marshall that instead.
Second, on return, libffi actually returns a pointer to a value
that's sized according to platform conventions, not according to
what the caller requested. ie if ffi_type_sint was requested, the
value can still be a 64-bit sign-extended long on a 64-bit
architecture like PPC64, thus the caller cannot simply cast
the return value as a pointer to the desired type, but must cast
as a pointer to an integral type and then cast to the desired
type to remove any sign extension complications.
For more information on how to correctly handle libffi return
values, see the following bug, specifically comment 35:
https://bugzilla.redhat.com/show_bug.cgi?id=736489
"For 64-bit ABIs that extend integral returns types to 64-bits, libffi always
returns full 64-bit values that you can truncate in the calling code. It's
just the way it is has always been. Please don't change libffi. I'll document
this clearly for the next version (perhaps there is a mention of this, I
haven't looked yet).
The same is true for returning 8-bit values, for instance, on 32-bit systems.
All ABIs extend those results to the full 32-bits so you need to provide a
properly aligned buffer that's big enough to hold the result."
https://bugzilla.gnome.org/show_bug.cgi?id=659881
Colin Walters [Wed, 5 Oct 2011 15:27:45 +0000 (11:27 -0400)]
gmacros: Hide G_STATIC_ASSERT from g-ir-scanner
The C syntax here is twisted and confuses the scanner. We don't
need to see it, so let's just skip it.
https://bugzilla.gnome.org/show_bug.cgi?id=660413
Ryan Lortie [Wed, 5 Oct 2011 17:16:05 +0000 (13:16 -0400)]
Be sure to #include "gutils.h" in gbacktrace.c
0e3f530185d494dbb9db1b47f72f10f3ae598564 introduced a compiler warning
about implicit declaration of g_get_prgname(). Fix that.
Problem caught and fix suggested by Rico Tzschichholz.
David Zeuthen [Wed, 5 Oct 2011 16:33:55 +0000 (12:33 -0400)]
GDBus: Regenerate code when the codegen or options passed to it changes
https://bugzilla.gnome.org/show_bug.cgi?id=660498
Signed-off-by: David Zeuthen <davidz@redhat.com>
Dan Winship [Wed, 5 Oct 2011 15:45:51 +0000 (11:45 -0400)]
Fix up some doc comments that referred to threads not being enabled
(and a few other unrelated comment fixes)
David Zeuthen [Wed, 5 Oct 2011 14:56:11 +0000 (10:56 -0400)]
GDBus: disable two more GDBus tests using fork()
Signed-off-by: David Zeuthen <davidz@redhat.com>
David Zeuthen [Tue, 4 Oct 2011 15:37:16 +0000 (11:37 -0400)]
GDBusProxy: Correctly handle unknown members when having an expected interface
Since it is valid for a D-Bus interface / service to add new methods,
signals or properties we must NEVER warn about unknown properties or
drop unknown signals or disallow unknown method invocations when we
have an expected interface.
So this means that the expected_interface machinery is only useful for
checking that the service didn't break ABI.
Also update the docs so it is clear exactly what it means to have an
expected interface.
https://bugzilla.gnome.org/show_bug.cgi?id=660886
Signed-off-by: David Zeuthen <davidz@redhat.com>
Dan Winship [Wed, 5 Oct 2011 12:36:03 +0000 (08:36 -0400)]
gthreadedresolver: remove a bit of cruft
Remove a test that only made sense when GThreadedResolver was the base
class for the two non-threaded resolver classes that no longer exist.
Matthias Clasen [Tue, 4 Oct 2011 05:25:26 +0000 (01:25 -0400)]
Remove cruft from g_strerror and g_strsignal
We can just assume that strerror/strsignal are available
nowadays. At the same time, drop use of thread-private storage.
Instead, always return interned strings.
https://bugzilla.gnome.org/show_bug.cgi?id=660849
Matthias Clasen [Wed, 5 Oct 2011 05:04:42 +0000 (01:04 -0400)]
Misc test coverage improvements
https://bugzilla.gnome.org/show_bug.cgi?id=660849
Matthias Clasen [Wed, 5 Oct 2011 05:04:02 +0000 (01:04 -0400)]
Need to check for prlimit
Matthias Clasen [Wed, 5 Oct 2011 04:28:53 +0000 (00:28 -0400)]
Add a test for thread creation failure
Ryan Lortie [Wed, 5 Oct 2011 00:31:33 +0000 (20:31 -0400)]
gthread.h: a bunch of pointless whitespace changes
Make it look pretty.
Ryan Lortie [Wed, 5 Oct 2011 00:23:20 +0000 (20:23 -0400)]
Move typedef GStaticPrivate to deprecated/
This was missed in the earlier move.
Ryan Lortie [Tue, 4 Oct 2011 23:09:43 +0000 (19:09 -0400)]
Deprecate g_{mutex,cond}_{new,free}()
Now that we have _init() and _clear(), these old calls are no longer
useful.
https://bugzilla.gnome.org/show_bug.cgi?id=660739
Ryan Lortie [Wed, 5 Oct 2011 00:07:31 +0000 (20:07 -0400)]
gdbusprivate: fix a missed g_mutex_free()
This should have been changed to g_mutex_clear()
Ryan Lortie [Tue, 4 Oct 2011 23:04:41 +0000 (19:04 -0400)]
Remove g_mutex_new()/g_cond_new() in testcases
These were the last users of the dynamic allocation API.
Keep the uses in glib/tests/mutex.c since this is actually meant to test
the API (which has to continue working, even if it is deprecated).
https://bugzilla.gnome.org/show_bug.cgi?id=660739
Ryan Lortie [Tue, 4 Oct 2011 22:52:55 +0000 (18:52 -0400)]
drop errorcheck mutex test
We don't support errorchecking mutexes in GLib anymore.
Ryan Lortie [Tue, 4 Oct 2011 21:27:27 +0000 (17:27 -0400)]
GVariant: add a clarification to the docs
Add a note to the doc for g_viarnat_get_child_value() that the return
value is non-floating and must be freed with g_variant_unref().
https://bugzilla.gnome.org/show_bug.cgi?id=654412
Ryan Lortie [Tue, 4 Oct 2011 21:17:01 +0000 (17:17 -0400)]
gtimer: remove warnings about threads
GTimer no longer uses the thread system for time information and
g_thread_init() no longer does anything, so remove the doubly-untrue
warning about these topics.
https://bugzilla.gnome.org/show_bug.cgi?id=527214
Ryan Lortie [Tue, 4 Oct 2011 20:52:03 +0000 (16:52 -0400)]
end the glib-ctor experiment
This was a bad approach. We attempt to handle initailisation in a more
centralised way now.
Ryan Lortie [Tue, 4 Oct 2011 20:36:53 +0000 (16:36 -0400)]
Test that g_slice_set_config() works
For a while it didn't work, due to the ctor-based initialisation of
gslice.
https://bugzilla.gnome.org/show_bug.cgi?id=660887
Ryan Lortie [Tue, 4 Oct 2011 20:38:28 +0000 (16:38 -0400)]
gslice: stop using ctors
We can't initialise gslice from a ctor because g_slice_set_config() must
be called before gslice initialisation.
Instead, do the initialisation in a threadsafe way from the
initialisation function for the thread private data. This will only be
called once per thread so the synchronisation doesn't pose a significant
overhead here.
Ensure that we try to grab the thread private data directly on entrance
to g_slice_alloc() so that we force the initialisation to occur.
Grabbing the private data is the common case anyway.
https://bugzilla.gnome.org/show_bug.cgi?id=660887