Commit Graph

10920 Commits

Author SHA1 Message Date
Ryan Lortie
d7aeae97ef gthread.h: remove some bogus decl/comments
These are no longer relevent since the possibility of a thread-disabled
GLib disappeared.
2011-09-21 16:06:56 -04:00
Ryan Lortie
894dd4f62b Revert "Drop an unused variable"
This reverts commit c7f9cd17d446938aaf4126e0753302676f66fd22.

The old macros in gthread.h used this variable, so it must remain in
place to keep ABI compatibility.
2011-09-21 16:06:56 -04:00
Matthias Clasen
8ef30eb3da Drop an unused variable 2011-09-21 16:06:56 -04:00
Matthias Clasen
7d859fb67f More header cosmetics 2011-09-21 16:06:56 -04:00
Matthias Clasen
c291259c65 trivial: small header reordering 2011-09-21 16:06:56 -04:00
Ryan Lortie
ae2ac9e809 Move some things to deprecated/gthread.h 2011-09-21 16:06:56 -04:00
Ryan Lortie
97972fbb3a g_thread_init: take a gpointer as the arg
GThreadFunctions is about to disappear.
2011-09-21 16:06:56 -04:00
Ryan Lortie
abba53e396 disable glib-ctor on win32 2011-09-21 16:06:55 -04:00
Ryan Lortie
14e6377a60 Deprecate g_thread_create_full()
Replace it with g_thread_create_with_stack_size() and a real function
implementation of g_thread_create().

Modify a testcase that was calling g_thread_create_full()
inappropriately (it was using the default values anyway).
2011-09-21 16:06:55 -04:00
Ryan Lortie
9621b1093e Drop g_thread_fail()
This is now unused.
2011-09-21 16:06:55 -04:00
Ryan Lortie
b2c1364ab2 g_system_thread_create: drop unused args
The 'bound' and 'priority' arguments are no longer in use, so drop them.
2011-09-21 16:06:55 -04:00
Ryan Lortie
2b4c303d61 Remove the concept of 'bound'
This was ignored on Windows.  On POSIX, where supported, it controlled
if we ended up with a proper system thread or a user-mode thread.  Linux
did not support this.
2011-09-21 16:06:55 -04:00
Matthias Clasen
cebcfed783 Remove a leftover from errorcheck mutexes 2011-09-21 16:06:55 -04:00
Ryan Lortie
cffed9a03a Remove g_thread_functions_for_glib_use_old
This has been unused for a while and it should definitely go away now
that g_thread_functions_for_glib_use is back in gthread.c.
2011-09-21 16:06:55 -04:00
Ryan Lortie
6972ed340b Merge g_thread_functions_for_glib_use
Move the now-identical copies of g_thread_functions_for_glib_use from
gthread-{posix,win32}.c back into gthread.c.
2011-09-21 16:06:55 -04:00
Ryan Lortie
6ea1721191 gthread.h: drop the vtable access macros
We're finally free of these.  Drop them.
2011-09-21 16:06:55 -04:00
Ryan Lortie
3422dcfd28 NULL g_system_thread_{exit,equal} in the vtable
These were never used from gthread.h and are no longer used from
gthread.c.
2011-09-21 16:06:55 -04:00
Ryan Lortie
7a69d46dc5 GSystemThread: port 'self' 'join' and 'create'
Switch 'self' 'join' and 'create' from using the vtable to being called
via normal g_system_thread_* internal API (implemented in each of
gthread-{posix,win32}.c).

Again, we can put NULL in the vtable since these were never used from
gthread.h.
2011-09-21 16:06:55 -04:00
Ryan Lortie
51d92adeee GThread: deprecate thread priorities
Thread priorities were already documented as not working on Solaris, and
they are meaningless on Linux unless the process separately requests
realtime scheduling (and even then, it appears only to work as root).

We can safely put a NULL into the vtable for set_priority since nothing
outside of gthread.c ever calls this (and that call is gone).
2011-09-21 16:06:54 -04:00
Matthias Clasen
a10306060c Don't use the thread_exit vfunc
Instead, just have the backends implement an internal function
named g_system_thread_exit.
2011-09-21 16:06:54 -04:00
Matthias Clasen
cc7631cd19 Don't use the thread_equal vfunc anymore
Just move the g_system_thread_equal implementation into
the posix and win32 implementations, and drop some micro macro
optimization.
2011-09-21 16:06:54 -04:00
Ryan Lortie
e00bcfcdec gthread-win32: use __stdcall markers where needed
The "unknown reason" that the native thread implementation was broken is
because functions in kernel32.dll are (obviously) following Microsoft's
__stdcall ABI, not the GCC ABI.

Change our function pointers to be __stdcall pointers and change our
emulated implementation to match.
2011-09-21 16:06:54 -04:00
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