Commit Graph

10831 Commits

Author SHA1 Message Date
Ryan Lortie
8e43470c38 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().
2011-10-02 20:04:03 -04:00
Matthias Clasen
7a75f56aa1 Add a few comments 2011-10-02 19:10:16 -04:00
Matthias Clasen
7df7c53557 Add another GCond test
This test shows how to implement a barrier using a GCond.
2011-10-02 19:09:24 -04:00
Matthias Clasen
1a5cc98ca2 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
2011-10-02 18:32:41 -04:00
Matthias Clasen
6a31cc66cd Whitespace fixes 2011-10-02 17:11:42 -04:00
Matthias Clasen
3c02c64474 Clean up includes 2011-10-02 17:05:14 -04:00
Matthias Clasen
6d2b2ccaa0 Add tests for GPrivate and GStaticPrivate 2011-10-02 16:51:32 -04:00
Javier Jardón
3659ca99f5 tests: Use G_VALUE_INIT 2011-10-02 17:22:57 +01:00
Javier Jardón
91713e950f docs: Use G_VALUE_INIT 2011-10-02 17:22:18 +01:00
Ryan Lortie
406f7d2b39 mutex testcase: add a performance test
Add a reasonable performance test for uncontended and contended cases.
2011-10-02 00:13:18 -04:00
Matthias Clasen
6ef022bbb3 Move all hash functions to ghash.c
This matches their location in the headers.
2011-10-02 00:08:54 -04:00
Matthias Clasen
e7ca67f20c GHash: Cosmetic changes 2011-10-02 00:08:13 -04:00
Matthias Clasen
ed325b1879 One forgotten moved doc 2011-10-01 23:38:52 -04:00
Matthias Clasen
10d86cda02 Move GStringChunk into its own files 2011-10-01 23:38:23 -04:00
Matthias Clasen
0e8bcc3ed7 Move GString docs inline 2011-10-01 23:27:45 -04:00
Matthias Clasen
459b14d89a GString: cosmetic cleanups 2011-10-01 23:23:40 -04:00
Matthias Clasen
7154d44c5c Move file utility docs inline 2011-10-01 23:03:09 -04:00
Matthias Clasen
ca77b0e252 Move string utility docs inline 2011-10-01 22:48:27 -04:00
Matthias Clasen
793ff83527 Move test docs inline 2011-10-01 22:00:41 -04:00
Matthias Clasen
9d3b37ac3f Move keyfile docs inline 2011-10-01 21:03:14 -04:00
Matthias Clasen
3d814e7a2a GAsyncQueue: simplify an internal function
g_cond_timed_wait() behaves like g_cond_wait() when given
NULL, so no need have different branches for that in
g_async_queue_pop_intern_unlocked().
2011-10-01 20:22:47 -04:00
Matthias Clasen
8c5400ff45 GAsyncQueue: internal cleanup
Turn the 'try' parameter of g_async_queue_pop_intern_unlocked
into a 'wait', for better alignment with the GCond api.
2011-10-01 20:22:47 -04:00
Matthias Clasen
793cf54275 GAsyncQueue: embed the GCond
Use g_cond_init/clear, now that we have them.
2011-10-01 20:22:46 -04:00
Matthias Clasen
ef08aa786b GAsyncQueue: Cosmetic fixes
Mostly doc formatting and whitespace fixes.
2011-10-01 20:22:46 -04:00
Matthias Clasen
93abf20d3b GAsyncQueue: Move private API to a private header 2011-10-01 20:22:46 -04:00
Matthias Clasen
b17b02da79 GThreadPool: cosmetic cleanups
Mostly documentation and formatting trivial, but also add
boolean return types to GError taking functions.
2011-10-01 20:22:46 -04:00
Matthias Clasen
81e161edf2 GThread: cosmetic fix
Explicitly include gthread.h, don't rely on gthreadprivate.h
to pull it in.
2011-10-01 20:22:45 -04:00
Nguyễn Thái Ngọc Duy
5135241633 Updated Vietnamese translation 2011-10-02 11:21:29 +11:00
Nguyễn Thái Ngọc Duy
98818afa08 po/vi: import from Damned Lies 2011-10-02 11:21:28 +11:00
Matthias Clasen
1af5ac0179 Add an index for 2.32 api additions 2011-10-01 13:47:54 -04:00
Matthias Clasen
b4dc4902c6 Mark g_thread_create_with_stack_size as new API 2011-10-01 13:47:09 -04:00
Ryan Lortie
65b7a20c67 GSettings schemas: allow for zero items in schema
GVDB deals with empty lists by returning NULL for the list instead of a
zero-length (non-NULL) strv.  We can work around that in GSettingsSchema
by checking for the NULL case and treating it like a zero-length list.

https://bugzilla.gnome.org/show_bug.cgi?id=660147
2011-10-01 09:34:44 -04:00
Jasper Lievisse Adriaanse
e147d7aa2f Fix URL to strlcpy(3) manpage in comment. 2011-10-01 10:46:52 +02:00
Simon McVittie
c48a0d8813 markup-subparser test: use a real GError domain
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=660371
2011-09-30 13:17:27 +01:00
Simon McVittie
7aad93c5b4 sleepy-stream test: use a real GError domain
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=660371
2011-09-30 13:17:27 +01:00
Simon McVittie
e60e4999b9 g_dbus_error_encode_gerror: don't segfault on bad domains
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=660371
2011-09-30 13:17:27 +01:00
Matthias Clasen
5156d1b2d4 Prevent data loss in gdesktopappinfo.c
Don't loose the content of mimeapps.list when it doesn't contain
a [Added Associations] group. Pointed out by Alexander Larsson.

https://bugzilla.gnome.org/show_bug.cgi?id=660130
2011-09-29 23:42:58 -04:00
Matthias Clasen
e6c76d9fd4 Clean up atomic cruft
Nothing is using these defines anymore, and the messages
are misleading. Based on a patch by Kean Johnston.

https://bugzilla.gnome.org/show_bug.cgi?id=660013
2011-09-29 23:20:09 -04:00
Matthias Clasen
cde8cf16fa Some more gthread reshuffling 2011-09-29 20:23:19 -04:00
David Zeuthen
934e0a7470 GUnixFileMonitor: Clean up /proc/mounts monitoring
Most suggestions from Colin Walters <walters@verbum.org>.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-29 15:49:09 -04:00
David Zeuthen
55065461bf GUnixFileMonitor: Use /proc/mounts for monitoring mount changes
On recent Linux distros /etc/mtab is just a symlink to /proc/mounts
and GFileMonitor does not work there because of how the kernel conveys
that the file changes.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-29 15:16:51 -04:00
Javier Jardón
6d05f684eb gfile: Be clear about freeing GFile objects 2011-09-29 20:04:28 +01:00
Dan Winship
f992c240e8 gthread: remove a stray reference to GStaticMutex 2011-09-29 09:59:15 -04:00
Tiffany Antopolski
76d2f7fa6a Updated Esperanto translation 2011-09-29 06:24:55 +02:00
Dan Winship
0f4b278a4b update .gitignores 2011-09-28 12:20:09 -04:00
Dan Williams
6feff14f19 tests: add signal marshalling return tests for int/uint
https://bugzilla.gnome.org/show_bug.cgi?id=659881
2011-09-28 11:01:53 -05:00
Dan Williams
a343904596 tests: fix generic closure marshalling tests
We're testing enums here, not flags, so we need to make sure
we're trying to send enums through the marshalling.

https://bugzilla.gnome.org/show_bug.cgi?id=659881
2011-09-28 11:01:39 -05:00
Dan Williams
adf7e0740c tests: Add some return value torture testcases for the generic marshaller
Ensure that ENUM types are properly marshalled back from libffi types
to glib types, which was failing on ppc64.

https://bugzilla.gnome.org/show_bug.cgi?id=659881
2011-09-28 11:01:14 -05:00
Dan Winship
51166d0127 Add thread-safety warnings to the g_setenv() and g_unsetenv() docs
https://bugzilla.gnome.org/show_bug.cgi?id=659326
2011-09-27 10:30:39 -04:00
Ryan Lortie
104ea17125 GDesktopAppInfo: simplify how defaults work
Previously, we took the default application for a particular mimetype
from the system and copied it into the user's configuration as the
default there.

Instead of doing that we leave the user's default unset, and at time of
use, if the user has no explicitly-set default value, we use the system
default.

This avoids complicated situations where inappropriate applications were
being set as the default in the user's configuration.

https://bugzilla.gnome.org/show_bug.cgi?id=658188
2011-09-26 16:54:24 -04:00