platform/upstream/glib.git
13 years agoBe sure to #include "gutils.h" in gbacktrace.c
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.

13 years agoGDBus: Regenerate code when the codegen or options passed to it changes
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>
13 years agoFix up some doc comments that referred to threads not being enabled
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)

13 years agoGDBus: disable two more GDBus tests using fork()
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>
13 years agoGDBusProxy: Correctly handle unknown members when having an expected interface
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>
13 years agogthreadedresolver: remove a bit of cruft
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.

13 years agoRemove cruft from g_strerror and g_strsignal
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

13 years agoMisc test coverage improvements
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

13 years agoNeed to check for prlimit
Matthias Clasen [Wed, 5 Oct 2011 05:04:02 +0000 (01:04 -0400)]
Need to check for prlimit

13 years agoAdd a test for thread creation failure
Matthias Clasen [Wed, 5 Oct 2011 04:28:53 +0000 (00:28 -0400)]
Add a test for thread creation failure

13 years agogthread.h: a bunch of pointless whitespace changes
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.

13 years agoMove typedef GStaticPrivate to deprecated/
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.

13 years agoDeprecate g_{mutex,cond}_{new,free}()
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

13 years agogdbusprivate: fix a missed g_mutex_free()
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()

13 years agoRemove g_mutex_new()/g_cond_new() in testcases
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

13 years agodrop errorcheck mutex test
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.

13 years agoGVariant: add a clarification to the docs
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

13 years agogtimer: remove warnings about threads
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

13 years agoend the glib-ctor experiment
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.

13 years agoTest that g_slice_set_config() works
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

13 years agogslice: stop using ctors
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

13 years agowin32: stop leaking GPrivate data
Ryan Lortie [Tue, 4 Oct 2011 20:08:27 +0000 (16:08 -0400)]
win32: stop leaking GPrivate data

Instead of running the GPrivate destructors from our thread proxy code,
run it from the DllMain handler for the DLL_THREAD_DETACH case.

This should ensure that thread-local data is free at the exit of all
threads -- not just the ones we created for ourselves.

https://bugzilla.gnome.org/show_bug.cgi?id=660745

13 years agoAdd GPrivate destroy notify testcase
Ryan Lortie [Tue, 4 Oct 2011 20:02:16 +0000 (16:02 -0400)]
Add GPrivate destroy notify testcase

Ensure that GPrivate destroy notifies are properly called.

This test currently fails on win32 (where we are leaking).

https://bugzilla.gnome.org/show_bug.cgi?id=660745

13 years agowin32 fixes from g_thread_init() deprecation
Ryan Lortie [Tue, 4 Oct 2011 19:44:48 +0000 (15:44 -0400)]
win32 fixes from g_thread_init() deprecation

I can't even begin to imagine how these fell through the cracks...

13 years agogitignore
Ryan Lortie [Tue, 4 Oct 2011 19:34:15 +0000 (15:34 -0400)]
gitignore

13 years agoDeprecate g_thread_init()
Ryan Lortie [Tue, 4 Oct 2011 19:30:39 +0000 (15:30 -0400)]
Deprecate g_thread_init()

Move the last few things that needed thread-safe initialisation to a
global ctor.

https://bugzilla.gnome.org/show_bug.cgi?id=660744

13 years agoClean up process of calling g_debug_init()
Ryan Lortie [Thu, 22 Sep 2011 01:20:07 +0000 (21:20 -0400)]
Clean up process of calling g_debug_init()

Make sure that it calls absolutely nothing that may ever recurse back
into GLib again:

  - g_ascii_strcasecmp() is unsafe because it has g_return_if_fail() at
    the top.  As far as I know, the only ASCII character letter that
    would get special treatment here is "i" and that appears in neither
    "help" nor "all".

  - g_getenv() is very complicated on Windows, so use a simple version
    that is sufficient for our purposes.

Now that it's completely safe, we can just call it from g_logv() in the
usual way without all of the hacks.

https://bugzilla.gnome.org/show_bug.cgi?id=660744

13 years agoAdd _g_io_module_get_default(), use to simplify other *_get_default()s
Dan Winship [Tue, 21 Jun 2011 22:21:27 +0000 (18:21 -0400)]
Add _g_io_module_get_default(), use to simplify other *_get_default()s

Add _g_io_module_get_default(), which implements the
figure-out-the-best-available-module-that-is-actually-usable logic,
and use that to simplify g_proxy_resolver_get_default(),
g_settings_backend_get_default(), g_tls_backend_get_default(), and
g_vfs_get_default().

https://bugzilla.gnome.org/show_bug.cgi?id=620932

13 years agogsettingsbackend: remove useless check
Dan Winship [Thu, 22 Sep 2011 15:52:53 +0000 (11:52 -0400)]
gsettingsbackend: remove useless check

GMemorySettingsBackend is always present, so there's no need to check
for "no backends available"

https://bugzilla.gnome.org/show_bug.cgi?id=620932

13 years agogio/tests/socket-client: fix a crash (and some indentation)
Dan Winship [Tue, 4 Oct 2011 17:19:21 +0000 (13:19 -0400)]
gio/tests/socket-client: fix a crash (and some indentation)

13 years agoBug 660851: Update GIO for changes in GThread API
Chun-wei Fan [Tue, 4 Oct 2011 15:52:38 +0000 (23:52 +0800)]
Bug 660851: Update GIO for changes in GThread API

gsocket.c: Use intern string instead of GStaticPrivate/
           g_static_private_set, as Dan suggested.

13 years ago[gio] Improve doc for g_file_make_directory_with_parents()
Bastien Nocera [Mon, 3 Oct 2011 14:27:15 +0000 (15:27 +0100)]
[gio] Improve doc for g_file_make_directory_with_parents()

g_file_make_directory_with_parents() will fail for already
existing directories, unlike g_mkdir_with_parents(), so mention
this clearly in the docs.

https://bugzilla.gnome.org/show_bug.cgi?id=660791

13 years agoFix an invalid non-looping use of GCond
Ryan Lortie [Tue, 4 Oct 2011 15:07:15 +0000 (11:07 -0400)]
Fix an invalid non-looping use of GCond

The GIOScheduler was using a GCond in a way that didn't deal with the
possibility of spurious wakeups.  Add an explicit predicate and a loop.

Problem caught by Matthias Clasen.

https://bugzilla.gnome.org/show_bug.cgi?id=660739

13 years agoGIO: switch a couple more GMutex users to _init()
Ryan Lortie [Tue, 4 Oct 2011 03:44:37 +0000 (23:44 -0400)]
GIO: switch a couple more GMutex users to _init()

Move a couple more GIO users off of _new()/_free() to _init()/_clear().

https://bugzilla.gnome.org/show_bug.cgi?id=660739

13 years agoMake G_ASSERT_STATIC work with clang
Ryan Lortie [Tue, 4 Oct 2011 15:52:47 +0000 (11:52 -0400)]
Make G_ASSERT_STATIC work with clang

A simplified variant of an approach proposed by Behdad.

https://bugzilla.gnome.org/show_bug.cgi?id=660413

13 years agoGDBus codegen: generate code with embedded GMutex
Ryan Lortie [Tue, 4 Oct 2011 04:09:53 +0000 (00:09 -0400)]
GDBus codegen: generate code with embedded GMutex

Modify GDBus code generator to emit code that uses GMutex embedded into
the structure of the skeleton instead of a pointer.

https://bugzilla.gnome.org/show_bug.cgi?id=660739

13 years agoGThreadedResolver: port to embedded GMutex/GCond
Ryan Lortie [Tue, 4 Oct 2011 04:02:36 +0000 (00:02 -0400)]
GThreadedResolver: port to embedded GMutex/GCond

This is the only case that was non trivial to port, due to some of the
logic being based on checking the GCond* for being non-%NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=660739

13 years agoGMain, ThreadPool: embed GCond in struct
Ryan Lortie [Tue, 4 Oct 2011 03:52:13 +0000 (23:52 -0400)]
GMain, ThreadPool: embed GCond in struct

Use an embedded GCond and g_cond_init()/clear() instead of a pointer
with g_cond_new() and _free().

https://bugzilla.gnome.org/show_bug.cgi?id=660739

13 years agoGCancellable: use GCond and GMutex directly
Ryan Lortie [Tue, 4 Oct 2011 03:33:57 +0000 (23:33 -0400)]
GCancellable: use GCond and GMutex directly

Use a statically-allocated GCond and directly use GMutex instead of
making use of the undocumented G_LOCK_NAME() macro.

https://bugzilla.gnome.org/show_bug.cgi?id=660739

13 years agoGDBus: switch to struct-embedded GMutex and GCond
Ryan Lortie [Tue, 4 Oct 2011 03:26:55 +0000 (23:26 -0400)]
GDBus: switch to struct-embedded GMutex and GCond

Now that we have those, we should use them.

https://bugzilla.gnome.org/show_bug.cgi?id=660739

13 years agogstringchunk.c: Include gutils.h
Chun-wei Fan [Tue, 4 Oct 2011 05:56:30 +0000 (13:56 +0800)]
gstringchunk.c: Include gutils.h

This is due to usage of the inline keyword which may not be universally
defined unless guils.h is included.

13 years agoAdd README notes about recent changes
Ryan Lortie [Tue, 4 Oct 2011 14:59:29 +0000 (10:59 -0400)]
Add README notes about recent changes

13 years agomacro wrappers for g_once_init_enter/leave
Ryan Lortie [Mon, 3 Oct 2011 18:40:00 +0000 (14:40 -0400)]
macro wrappers for g_once_init_enter/leave

Give the macro wrapper treatment to g_once_init_enter() and leave() in
the same style that we did for gatomic.

It is now possible to use these macros with any pointer-sized object,
and not just gsize.  The leave() macro ensures that the initialisation
result is a compatible type with the pointer that it is being written
to.

Just like with gatomic, there could be problems caused by use of (void*)
casts.  We'll see how that goes, and reevaluate if necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=660743

13 years agoFix DATADIRNAME on OpenBSD.
Antoine Jacoutot [Tue, 4 Oct 2011 05:52:10 +0000 (07:52 +0200)]
Fix DATADIRNAME on OpenBSD.

On OpenBSD translation files are always installed under PREFIX/share/locale,
there is no such thing as PREFIX/lib/locale; according to that, set
DATADIRNAME to "share".

13 years agorec-mutex testcase: add a performance test
Ryan Lortie [Sun, 2 Oct 2011 16:08:56 +0000 (12:08 -0400)]
rec-mutex testcase: add a performance test

Add a reasonable performance test for uncontended and contended cases at
different levels of recursion depth.

13 years agoIn the GVariant intro, mention lack of built-in endianness, and rationale
Simon McVittie [Mon, 3 Oct 2011 13:27:15 +0000 (14:27 +0100)]
In the GVariant intro, mention lack of built-in endianness, and rationale

Presumably, the rationale for not storing the endianness is that
GVariant is a recursive type system, and in a sane format, endianness
only needs to be stored once per blob of data (once per D-Bus message,
once per file on disk, etc.).

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=632049
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ryan Lortie <desrt@desrt.ca>
13 years agog_variant_get_data: mention what you need to know to deserialise
Simon McVittie [Mon, 3 Oct 2011 13:20:51 +0000 (14:20 +0100)]
g_variant_get_data: mention what you need to know to deserialise

Also include a shorter version in the docs for g_variant_store, with a
pointer to g_variant_get_data.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=632049
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ryan Lortie <desrt@desrt.ca>
13 years agog_variant_new_from_data: mention that the caller might need to byteswap
Simon McVittie [Mon, 3 Oct 2011 13:19:58 +0000 (14:19 +0100)]
g_variant_new_from_data: mention that the caller might need to byteswap

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=632049
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ryan Lortie <desrt@desrt.ca>
13 years agoFix a typo in describing GVariant serialisation functions
Simon McVittie [Tue, 4 Oct 2011 11:39:08 +0000 (12:39 +0100)]
Fix a typo in describing GVariant serialisation functions

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=632049
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ryan Lortie <desrt@desrt.ca>
13 years agoEscape percent sign in g_variant_new_parsed documentation
Simon McVittie [Tue, 4 Oct 2011 09:46:13 +0000 (10:46 +0100)]
Escape percent sign in g_variant_new_parsed documentation

Strings matching /%[a-z]/ are special syntax for gtk-doc.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=632049
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ryan Lortie <desrt@desrt.ca>
13 years agog_variant_get_fixed_array: document which types are appropriate
Simon McVittie [Wed, 13 Oct 2010 11:22:41 +0000 (12:22 +0100)]
g_variant_get_fixed_array: document which types are appropriate

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=632049
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ryan Lortie <desrt@desrt.ca>
13 years agoGVariant docs: be clear that the serialisation format isn't the same as D-Bus
Simon McVittie [Wed, 13 Oct 2010 11:21:22 +0000 (12:21 +0100)]
GVariant docs: be clear that the serialisation format isn't the same as D-Bus

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=632049
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ryan Lortie <desrt@desrt.ca>
13 years agoBe clear that g_str_hash etc. don't accept NULL
Simon McVittie [Tue, 4 Oct 2011 08:48:35 +0000 (09:48 +0100)]
Be clear that g_str_hash etc. don't accept NULL

This covers the str, double, int, int64 hash and equal functions, but not
anything that takes an "object", since the convention is that "object
methods" never accept NULL anyway.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=592715
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Colin Walters <walters@verbum.org>
13 years agoBe completely clear about what g_direct_hash, g_direct_equal do
Simon McVittie [Tue, 4 Oct 2011 08:44:27 +0000 (09:44 +0100)]
Be completely clear about what g_direct_hash, g_direct_equal do

Also annotate them as (allow-none), more for the benefit of gtk-doc
readers than introspection.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=592715
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Colin Walters <walters@verbum.org>
13 years agoGHashTable: be more clear what g_int_hash wants
Simon McVittie [Tue, 4 Oct 2011 08:42:28 +0000 (09:42 +0100)]
GHashTable: be more clear what g_int_hash wants

Using g_int_hash, g_int_equal with keys like GINT_TO_POINTER (n) seems to
be a reasonably common GLib-novice mistake. It doesn't help that the
documentation for GHashFunc was ambiguous about this.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=592715
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Colin Walters <walters@verbum.org>
13 years agoWarn when classes/instances exceed the allowed size, if possible
Simon McVittie [Mon, 3 Oct 2011 17:48:15 +0000 (18:48 +0100)]
Warn when classes/instances exceed the allowed size, if possible

It's impossible to check this if the library user is using
g_type_register_static, but in that case their compiler should hopefully
warn about the truncation. This fixes it for G_DEFINE_TYPE and friends,
at least.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=659916
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Colin Walters <walters@verbum.org>
13 years agoUpdate glibconfig.h.win32(.in)
Chun-wei Fan [Tue, 4 Oct 2011 06:06:10 +0000 (14:06 +0800)]
Update glibconfig.h.win32(.in)

Update typedef of GStaticMutex here to match the typedef of GMutex
in glib/gthread.h (due to commit c5634df6)

13 years agoImprove test coverage in the thread tests
Matthias Clasen [Tue, 4 Oct 2011 04:46:10 +0000 (00:46 -0400)]
Improve test coverage in the thread tests

Use g_thread_new_full() in some places.

13 years agoImprove test coverage in the GString tests
Matthias Clasen [Tue, 4 Oct 2011 04:45:42 +0000 (00:45 -0400)]
Improve test coverage in the GString tests

13 years agoImprove testcoverage in the rec-mutex test
Matthias Clasen [Tue, 4 Oct 2011 04:44:58 +0000 (00:44 -0400)]
Improve testcoverage in the rec-mutex test

Test g_rec_mutex_trylock() in both locked and unlocked cases.

13 years agoAdd a few more tests
Matthias Clasen [Tue, 4 Oct 2011 03:55:02 +0000 (23:55 -0400)]
Add a few more tests

This brings test coverage for glist.c and glist.c to the
coveted 100% lines mark.

13 years agoRemove bits of dead code identified by coverage tests
Matthias Clasen [Tue, 4 Oct 2011 03:54:08 +0000 (23:54 -0400)]
Remove bits of dead code identified by coverage tests

These lines could were not hit by our tests, and examination
of the code reveals that they can't ever be hit.

13 years agoAdd some more thread tests
Matthias Clasen [Tue, 4 Oct 2011 02:22:55 +0000 (22:22 -0400)]
Add some more thread tests

13 years agoGAsyncQueue: properly set free function
Ryan Lortie [Tue, 4 Oct 2011 02:18:01 +0000 (22:18 -0400)]
GAsyncQueue: properly set free function

The copying of code from g_async_queue_new() to g_async_queue_new_full()
in ef08aa786bca87c520ef319b97df4b3ed0782233 copied the setting of the
free function to NULL (instead of the one passed in by the user).

Fix that up so that the test passes again.

https://bugzilla.gnome.org/show_bug.cgi?id=660843

13 years agoGUnixMountPoint: expose options
David Zeuthen [Fri, 30 Sep 2011 03:46:28 +0000 (23:46 -0400)]
GUnixMountPoint: expose options

Make the options from an /etc/fstab entry available as public API -
this can be used to support options such as

 comment=gvfs.name=Foo\040Bar

to e.g. set the name of an fstab mount in the UI to "Foo Bar".

https://bugzilla.gnome.org/show_bug.cgi?id=660536

Signed-off-by: David Zeuthen <davidz@redhat.com>
13 years agoRevert "GSettings: don't abort on missing schemas"
Ryan Lortie [Mon, 3 Oct 2011 14:19:14 +0000 (10:19 -0400)]
Revert "GSettings: don't abort on missing schemas"

This reverts commit c841c2ce3fda6f754c88ae2c9099f36dff2f0814.

This approach has been an unmitigated disaster.  We're getting all sorts
of crashes due to functions that are returning NULL because they can't
find the schema for the default value.  The people who get these crashes
are then confused about the root cause of the problem and waste a lot of
time trying to figure it out.

Until we find a better solution, we should go back to what we had
before.

https://bugzilla.gnome.org/show_bug.cgi?id=655366

13 years agoCosmetics
Matthias Clasen [Mon, 3 Oct 2011 03:53:56 +0000 (23:53 -0400)]
Cosmetics

13 years agoDocumentation fixes
Matthias Clasen [Mon, 3 Oct 2011 03:43:17 +0000 (23:43 -0400)]
Documentation fixes

13 years agoFix doc build
Matthias Clasen [Mon, 3 Oct 2011 02:38:49 +0000 (22:38 -0400)]
Fix doc build

The markup here was not only broken, it was also unnecessary,
since gtk-doc knows to apply <function></function> tags to things
that end with () already.

13 years agolocks: Add initialisation notes
Ryan Lortie [Mon, 3 Oct 2011 03:37:20 +0000 (23:37 -0400)]
locks: Add initialisation notes

For each of the 4, mention that static storage or _init() is needed.

13 years agolocks: change the ABI just a bit
Ryan Lortie [Mon, 3 Oct 2011 00:59:15 +0000 (20:59 -0400)]
locks: change the ABI just a bit

Add a little bit more room in the ABI for our synchronisation primatives
since we're going to need it when we add native implementations on
Linux.

Also: rename the pointer field and add /*< private >*/ annotations.

13 years agolocks: drop _INIT macros
Ryan Lortie [Mon, 3 Oct 2011 00:51:38 +0000 (20:51 -0400)]
locks: drop _INIT macros

All locks are now zero-initialised, so we can drop the G_*_INIT macros
for them.

Adjust various users around GLib accordingly and change the docs.

https://bugzilla.gnome.org/show_bug.cgi?id=659866

13 years agoRe-enable 'include' testcase
Ryan Lortie [Mon, 3 Oct 2011 01:03:49 +0000 (21:03 -0400)]
Re-enable 'include' testcase

The bug is fixed now.

https://bugzilla.gnome.org/show_bug.cgi?id=659866

13 years agoGThread posix: switch to Windows ABI
Ryan Lortie [Mon, 3 Oct 2011 00:43:28 +0000 (20:43 -0400)]
GThread posix: switch to Windows ABI

Modify the POSIX implementation of the synchronisation primatives to use
the same ABI as Windows: one pointer for each type.

This frees us from having to #include <pthread.h> and avoids the problem
with pthread_rwlock_t not being defined under certain compiler defines.

A few more changes are expected to the ABI -- they will be committed
separately.

https://bugzilla.gnome.org/show_bug.cgi?id=659866

13 years agoDon't use g_thread_foreach in tests
Matthias Clasen [Mon, 3 Oct 2011 02:31:45 +0000 (22:31 -0400)]
Don't use g_thread_foreach in tests

13 years agoDeprecate GStaticPrivate and g_thread_foreach
Matthias Clasen [Sun, 2 Oct 2011 05:29:08 +0000 (01:29 -0400)]
Deprecate GStaticPrivate and g_thread_foreach

This commit moves GStaticPrivate, g_thread_foreach and all
related functions and variables to gthread-deprecated.c. We
introduce some internal API to make this possible.

g_thread_foreach is not a very useful function, since there is
virtually nothing you can do with a GThread*, and implementing
it requires us to keep a list of threads around.

GStaticPrivate has been made redundant by adding comparable
capabilities to GPrivate.

https://bugzilla.gnome.org/show_bug.cgi?id=660635

13 years agoDon't put threads created with g_thread_new() on the list
Matthias Clasen [Sun, 2 Oct 2011 13:51:13 +0000 (09:51 -0400)]
Don't put threads created with g_thread_new() on the list

This lets us avoid the overhead of maintaining the global
list in the non-deprecated case.

https://bugzilla.gnome.org/show_bug.cgi?id=660635

13 years agoMake thread names useful in a debugger
Matthias Clasen [Sun, 2 Oct 2011 13:27:08 +0000 (09:27 -0400)]
Make thread names useful in a debugger

Associate the name with the system thread, so that debuggers
can see it. This is currently only implemented for Linux, using
prctl.

https://bugzilla.gnome.org/show_bug.cgi?id=660635

13 years agoAdd new thread creation API
Matthias Clasen [Sun, 2 Oct 2011 14:01:57 +0000 (10:01 -0400)]
Add new thread creation API

Deprecate both g_thread_create functions and add
g_thread_new() and g_thread_new_full(). The new functions
expect a name for the thread.

Change GThreadPool, GMainContext and GDBus to create named threads.

https://bugzilla.gnome.org/show_bug.cgi?id=660635

13 years agoDefine GLIB_COMPILATION when building libgthread.so
Matthias Clasen [Mon, 3 Oct 2011 01:57:06 +0000 (21:57 -0400)]
Define GLIB_COMPILATION when building libgthread.so

This is necessary, because gthreadprivate.h can only be
included inside GLib, otherwise single-include guards trigger.

13 years agoReplace static privates by privates
Matthias Clasen [Mon, 3 Oct 2011 01:57:40 +0000 (21:57 -0400)]
Replace static privates by privates

GStaticPrivate is heading for deprecation soon, and GPrivate
can replace these uses now.

13 years agowin32: fix GPrivate fallout
Ryan Lortie [Mon, 3 Oct 2011 01:13:14 +0000 (21:13 -0400)]
win32: fix GPrivate fallout

Fix minor mistake in win32 GPrivate code.

13 years agolocks: rename a bunch of parameters
Ryan Lortie [Mon, 3 Oct 2011 00:24:18 +0000 (20:24 -0400)]
locks: rename a bunch of parameters

13 years agoStop dithering over GPrivate
Ryan Lortie [Fri, 30 Sep 2011 18:22:04 +0000 (14:22 -0400)]
Stop dithering over GPrivate

Take out the half-private g_private_init() stuff and replace it with a
G_PRIVATE_INIT macro that allows specifying a GDestroyNotify.

Expose the GPrivate structure in a public header.

Add a g_private_replace() to (sort of) match the functionality of
g_static_mutex_set().

Improve the documentation.

Deprecate g_private_new().

13 years agoAdd a few comments
Matthias Clasen [Sun, 2 Oct 2011 23:10:16 +0000 (19:10 -0400)]
Add a few comments

13 years agoAdd another GCond test
Matthias Clasen [Sun, 2 Oct 2011 23:09:24 +0000 (19:09 -0400)]
Add another GCond test

This test shows how to implement a barrier using a GCond.

13 years agoRework the way GStaticPrivate data is freed
Matthias Clasen [Sun, 2 Oct 2011 05:21:46 +0000 (01:21 -0400)]
Rework the way GStaticPrivate data is freed

To avoid iterating threads in g_static_private_free(), defer freeing
the per-thread data to thread exit. The one complication here is
that it is possible for the static private index to be reused while
'old' data is still around. To deal with that case, store the 'owner'
with each per-thread data node, and free old data in
g_static_private_get() if the owner doesn't match. The remaining
possibility that a private index could be reused by a GStaticPrivate
with the same address is sufficiently unlikely that we can probably
ignore it.

With this change, per-thread data is now truly private again,
and we can drop the lock for it as well.

https://bugzilla.gnome.org/show_bug.cgi?id=660635

13 years agoWhitespace fixes
Matthias Clasen [Sun, 2 Oct 2011 13:59:26 +0000 (09:59 -0400)]
Whitespace fixes

13 years agoClean up includes
Matthias Clasen [Sun, 2 Oct 2011 21:05:03 +0000 (17:05 -0400)]
Clean up includes

13 years agoAdd tests for GPrivate and GStaticPrivate
Matthias Clasen [Sun, 2 Oct 2011 20:48:17 +0000 (16:48 -0400)]
Add tests for GPrivate and GStaticPrivate

13 years agotests: Use G_VALUE_INIT
Javier Jardón [Fri, 30 Sep 2011 16:21:52 +0000 (17:21 +0100)]
tests: Use G_VALUE_INIT

13 years agodocs: Use G_VALUE_INIT
Javier Jardón [Fri, 30 Sep 2011 16:04:23 +0000 (17:04 +0100)]
docs: Use G_VALUE_INIT

13 years agomutex testcase: add a performance test
Ryan Lortie [Sat, 1 Oct 2011 03:05:27 +0000 (23:05 -0400)]
mutex testcase: add a performance test

Add a reasonable performance test for uncontended and contended cases.

13 years agoMove all hash functions to ghash.c
Matthias Clasen [Sun, 2 Oct 2011 04:08:54 +0000 (00:08 -0400)]
Move all hash functions to ghash.c

This matches their location in the headers.

13 years agoGHash: Cosmetic changes
Matthias Clasen [Sun, 2 Oct 2011 04:08:13 +0000 (00:08 -0400)]
GHash: Cosmetic changes

13 years agoOne forgotten moved doc
Matthias Clasen [Sun, 2 Oct 2011 03:38:52 +0000 (23:38 -0400)]
One forgotten moved doc

13 years agoMove GStringChunk into its own files
Matthias Clasen [Sun, 2 Oct 2011 03:38:23 +0000 (23:38 -0400)]
Move GStringChunk into its own files

13 years agoMove GString docs inline
Matthias Clasen [Sun, 2 Oct 2011 03:27:45 +0000 (23:27 -0400)]
Move GString docs inline

13 years agoGString: cosmetic cleanups
Matthias Clasen [Sun, 2 Oct 2011 03:23:40 +0000 (23:23 -0400)]
GString: cosmetic cleanups

13 years agoMove file utility docs inline
Matthias Clasen [Sun, 2 Oct 2011 03:03:09 +0000 (23:03 -0400)]
Move file utility docs inline