Commit Graph

10798 Commits

Author SHA1 Message Date
Ryan Lortie
835c9b75c8 g_private_new: use GSlice
We no longer call g_private_new() from anywhere in GLib, so we can use
gslice instead of malloc().
2011-09-21 16:06:54 -04:00
Matthias Clasen
0ebd842d24 And move the g_thread_yield() docs too 2011-09-21 16:06:54 -04:00
Matthias Clasen
71df026580 Don't use the thread vtable for g_thread_yield() 2011-09-21 16:06:54 -04:00
Matthias Clasen
862e086b79 Move g_private_new() to common code
The implementations for posix and win32 were identical, so
move it to gthread.c, to go with g_mutex_new() and g_cond_new().
2011-09-21 16:06:54 -04:00
Matthias Clasen
dffca80846 Move docs around
Move the docs of functions to the actual functions. Also add
docs for some new apis.
2011-09-21 16:06:54 -04:00
Matthias Clasen
0044763a71 Clean up g_thread_yield implementation
This was the last macro wrapper that was directly accessing the
vtable. Make it a regular function, like the rest.
2011-09-21 16:06:54 -04:00
Ryan Lortie
c4a69e784e gmem: move to glib-ctor 2011-09-21 16:06:54 -04:00
Ryan Lortie
ae4419610c gslice: move initialisation to glib-ctor 2011-09-21 16:06:53 -04:00
Ryan Lortie
8f74c927f6 Add glib-ctor functionality
A pair of macros to define a constructor function (on compilers that
support such a concept) and to ensure that the function is run exactly
once (on compilers that lack such support).

Presently only GCC is implemented.
2011-09-21 16:06:53 -04:00
Ryan Lortie
0e604ef0b5 GThread: always initialise the system thread
It's always safe to call the thread implementation 'self' function.
2011-09-21 16:06:53 -04:00
Ryan Lortie
4596dfbc75 gmessages: do implicit GPrivate initialisation
Initialise the GPrivate implicitly at the site of first use rather than
explicitly from the thread initialisation function.
2011-09-21 16:06:53 -04:00
Ryan Lortie
90679997ec Continue GPrivate rework
We remove the macros while at the same time switching all libglib users
from g_private_new() to g_private_init().  We deal with the strange
expectations of the libglib code that g_private_* should work before the
GPrivate has been initialised with a temporary shim.
2011-09-21 16:06:53 -04:00
Ryan Lortie
b0d83576e2 Rework GPrivate
- expose the structure types for GLib internal use only

 - avoid infinite recursion hazards by ensuring that GPrivate never
   calls back into any other part of GLib

 - substantially rework the Windows implementation so that it never
   holds locks, contains no arbitrary limits and doesn't waste
   100*sizeof(void*) per thread

We have to keep the macro hacks for the time being since some code
inside libglib depends on it.
2011-09-21 16:06:53 -04:00
Ryan Lortie
4ec6d47806 GStaticMutex: remove ./configure checks
Now that GMutex is exposed we can avoid the dance we did in ./configure
to allocate the correct amount of space for it within the GStaticMutex.

Remove the checks and move the definitions to gthread.h, trying very
hard to keep ABI-stable (even though we will be deprecating this soon).
2011-09-21 16:06:53 -04:00
Ryan Lortie
c33cd00739 Stop using GStaticMutex in two testcases 2011-09-21 16:06:53 -04:00
Ryan Lortie
1da913a7a3 GParamSpecPool: port from GStaticMutex to GMutex 2011-09-21 16:06:53 -04:00
Ryan Lortie
806de91cd5 GSettings: port from GStaticMutex to GMutex 2011-09-21 16:06:53 -04:00
Ryan Lortie
646de11ae7 Remove "temporary until GLib is fixed" code
The original GMutex/GCond rework patch introduced some temporary code to
cope with GLib's old approach to thread initialisation.  These are no
longer required.
2011-09-21 16:06:53 -04:00
Ryan Lortie
e996a836e8 Port g_cond_new to use GSlice
Now that nothing inside of GLib is using g_cond_new(), we can implement
it using GSlice.  Since the implementations for POSIX and Windows are
now the same, move it to gthread.c.
2011-09-21 16:06:53 -04:00
Ryan Lortie
f1d34d0187 libglib: stop using g_cond_new in some places
Port a couple of low-level users of g_cond_new to use G_COND_INIT or
g_cond_init() as appropriate.
2011-09-21 16:06:52 -04:00
Ryan Lortie
22b3e26034 Port g_mutex_new to use GSlice
Now that nothing inside of GLib is using g_mutex_new, we can implement
it using GSlice.  Since the implementations for POSIX and Windows are
now the same, move it to gthread.c.
2011-09-21 16:06:49 -04:00
Ryan Lortie
cf26a6fc32 G_LOCK: port from GStaticMutex to GMutex
GCancellable made use of the undocumented G_LOCK_NAME macro in an
invalid way.  Fix that up while we're at it.
2011-09-21 15:55:36 -04:00
Ryan Lortie
2c7388c19a libglib: stop using g_mutex_new
Use G_MUTEX_INIT or g_mutex_init() as appropriate.
2011-09-21 15:55:36 -04:00
Ryan Lortie
f35362f3ae libglib: drop use of GStaticMutex
Use GMutex directly instead.
2011-09-21 15:55:36 -04:00
Ryan Lortie
80730bc75c Rework GMutex and GCond APIs
Do a substantial rework of the GMutex and GCond APIs.

 - remove all of the macro indirection hackery which is no longer needed
   since we dropped support for switchable thread implementations

 - expose the structure types and add G_MUTEX_INIT and G_COND_INIT
   static initialiser macros

 - add g_mutex_init() and g_mutex_clear() for use when embedding GMutex
   into another structure type and do the same for GCond as well

 - avoid infinite recursion hazards by ensuring that neither GCond or
   GMutex ever calls back into any other part of GLib

 - substantially rework the Windows implementation of GCond and GMutex
   to use the SRWLock and CONDITION_VARIABLE APIs present on Windows
   2008/Vista and later, emulating these APIs on XP
2011-09-21 15:55:36 -04:00
Matthias Clasen
c6f84faa17 Forgotten part of an earlier mismerge
This is making gmappedfile.c identical to the glib-2-30 branch again.
2011-09-21 15:47:26 -04:00
Ryan Lortie
43254e8c4c gmessage.c: mark a private function static 2011-09-21 15:27:47 -04:00
David Zeuthen
aabdb7e190 GDBusObject{Proxy,Skeleton}: Prefix properties with g- to avoid collisions
Otherwise we might collide with an interface called Connection.

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

This is for the same reason that GDBusProxy has its properties
prefixed with g-.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-21 12:35:40 -04:00
Ryan Lortie
1f5262d2c9 gunixmounts: exempt entries with "none" mountpoint
We ignore entries with mountpoint of "swap" and "ignore".  Add "none" to
that list, since Debian uses it.

Probably we should move to using our already-existing internal list of
things to ignore, but this patch is more minimally intrusive for now.

https://bugzilla.gnome.org/show_bug.cgi?id=654563
2011-09-21 10:20:08 -04:00
Xavier Claessens
6b39085016 gdbus-codegen: prepend arg_ to method/signal arg names
This is to avoid shadow declaration warning in the case an arg name
is "time" for example.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-21 07:45:50 -04:00
David Zeuthen
933ad70c32 gdbus-codegen: Clarify how naming and Ugly_Case handling works
Basically, move some paragraphs around.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-21 07:14:28 -04:00
David Zeuthen
30537b84de gdbus-codegen: Update man page to reflect how --annotate actually works
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-21 07:14:28 -04:00
Xavier Claessens
70515ffe92 gdbus-codegen: Fix build errors in generated code
https://bugzilla.gnome.org/show_bug.cgi?id=659646
2011-09-21 10:22:24 +02:00
Sweta Kothari
447eb03956 Removed the glib.glib-2-30.gu.po file that was wrongly committed 2011-09-21 12:20:40 +05:30
Sweta Kothari
45dd6801cf Updated Gujarati Translations 2011-09-21 12:20:40 +05:30
Sweta Kothari
06560292c6 Updated Gujarati Translations 2011-09-21 12:20:40 +05:30
Sweta Kothari
a7057f5c6e Updated Gujarati Translations 2011-09-21 12:20:40 +05:30
Sweta Kothari
0c1dba0643 Updated Gujarati Translations 2011-09-21 12:20:40 +05:30
Dan Winship
855e13cc0a GThreadedResolver: don't overwrite errors
If a dns op was cancelled and then the abandoned op failed, it would
try to overwrite the original error. Fix that.

https://bugzilla.gnome.org/show_bug.cgi?id=658769
2011-09-20 17:00:58 -04:00
Cosimo Cecchi
88b3f6b866 timeval: add introspection annotations to g_time_val_from_iso8601()
The GTimeVal argument is missing an (out) annotations.

https://bugzilla.gnome.org/show_bug.cgi?id=658692
2011-09-20 13:04:50 -04:00
Antoine Jacoutot
0db338bdb0 gunixmounts: Fix compilation on BSD
Commit afa82ae805 introduced a compilation
regression on BSD systems that use the sysctl(3) interface; we need to
declare the buffer len in _g_get_unix_mount_points()
BZ #659528
2011-09-20 16:58:00 +02:00
Matej Urbančič
11217edaaf Updated Slovenian translation 2011-09-20 15:40:29 +02:00
Matej Urbančič
9365bc5761 Updated Slovenian translation 2011-09-20 15:35:31 +02:00
Sweta Kothari
f8dda0955e Updated Gujarati Translations 2011-09-20 13:31:07 +05:30
David Zeuthen
88f2b32eb0 GDBusObjectManagerServer: Add test for export_uniquely() method
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-19 17:31:21 -04:00
Matthew Barnes
b1c08ca419 GDBusObjectManagerServer: Use correct object path in export_uniquely() method
In registration_data_export_interface(), the object_path is obtained using:

object_path = g_dbus_object_get_object_path (G_DBUS_OBJECT (data->object));

But when exporting an object uniquely, the object_path is not assigned
to the GDBusObject until after all the interfaces are exported.
Therefore, registration_data_export_interface() is trying to export
the interface on the non-unique object path, which can lead to
run-time errors if an object already exists on that path.

Instead, registration_data_export_interface() should be passed the
object_path explicitly, as is done in
g_dbus_object_manager_server_export_unlocked().

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-19 16:45:05 -04:00
Philip Withnall
fe27bf0037 Don't close stream twice when splicing
Ensure that the output/target stream in a g_output_stream_splice_async()
operation is marked as closed if G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET is
passed to g_output_stream_splice_async(). This removes the possibility of
local FDs being closed twice because the stream's not marked as closed.

This is implemented by calling g_output_stream_close() from within
g_output_stream_splice_async() instead of calling the stream's close_fn()
directly.

Closes: bgo#659324
2011-09-19 10:13:52 +02:00
Ryan Lortie
808035666a gbitlock: #include "gslice.h"
This is needed if we're doing emulated futexes.
2011-09-18 22:21:19 -04:00
Matthias Clasen
bb1ada7791 Fix a merge accident 2011-09-18 22:14:44 -04:00
Ryan Lortie
8b03fed0cf Remove unused header gdebug.h
This was only included from gmessages.c.  Nuke the unused parts and
merge the rest into gmessages.c.
2011-09-18 22:08:05 -04:00