platform/upstream/glib.git
12 years agoUpdate VS property sheets
Chun-wei Fan [Mon, 17 Oct 2011 06:17:53 +0000 (14:17 +0800)]
Update VS property sheets

Stop using G_DISABLE_DEPRECATED as there are now warnings for usage of
deprecated APIs/items in GLib

12 years agoinclude cleanup
Matthias Clasen [Mon, 17 Oct 2011 05:59:35 +0000 (01:59 -0400)]
include cleanup

12 years agoMake things compile again
Matthias Clasen [Mon, 17 Oct 2011 05:52:10 +0000 (01:52 -0400)]
Make things compile again

12 years agoMove gettext variations into their own files
Matthias Clasen [Mon, 17 Oct 2011 05:50:00 +0000 (01:50 -0400)]
Move gettext variations into their own files

12 years agoReshuffle some functions between gutils and gfileutils
Matthias Clasen [Mon, 17 Oct 2011 05:30:31 +0000 (01:30 -0400)]
Reshuffle some functions between gutils and gfileutils

Move filename-related functions to gfileutils, and move
size formatting functions to gutils.

12 years agoinclude cleanup
Matthias Clasen [Mon, 17 Oct 2011 05:30:09 +0000 (01:30 -0400)]
include cleanup

12 years agoTrivial
Matthias Clasen [Mon, 17 Oct 2011 05:11:56 +0000 (01:11 -0400)]
Trivial

12 years agoReshuffle genviron.c
Matthias Clasen [Mon, 17 Oct 2011 04:33:54 +0000 (00:33 -0400)]
Reshuffle genviron.c

Split win32 functions off into their own section, instead
of having large and unwieldy ifdef sections inside each function.

Also move the compat versions of env functions over from gutils.c

12 years agopush G_THREADS_MANDATORY over the cliff
Ryan Lortie [Mon, 17 Oct 2011 01:59:55 +0000 (21:59 -0400)]
push G_THREADS_MANDATORY over the cliff

This was used as an optimisation for the macro hackery that used to live
in gthread.h.  If a particular library or program knew that it could
rely on thread support being enabled, it would allow for static
evaluation of conditionals in some of those macros.

Since the macros are dead and thread support is now always-on, we can
get rid of this bit of legacy.

12 years agogobject/gio: some last missed statics/inclues
Ryan Lortie [Mon, 17 Oct 2011 01:53:03 +0000 (21:53 -0400)]
gobject/gio: some last missed statics/inclues

12 years agogthread/: fix up declarations
Ryan Lortie [Mon, 17 Oct 2011 01:50:26 +0000 (21:50 -0400)]
gthread/: fix up declarations

g_thread_init() is now a deprecated API, so drop G_DISABLE_DEPRECATED
from the CFLAGS for gthread/.  Add the missing declaration for
g_thread_init_with_errorcheck_mutexes() back to deprecated/gthread.h.

12 years agoAdd private prototype for g_thread_init_glib()
Ryan Lortie [Mon, 17 Oct 2011 00:58:02 +0000 (20:58 -0400)]
Add private prototype for g_thread_init_glib()

This function was never put in a header and was only used internally
from libgthread, but we should keep the symbol around to avoid
triggering any false-positives on ABI checkers.

For -Wmissing-prototypes compatibility with this unusual case, we should
add a private prototype in the .c file just before.

12 years agogio static fixups
Ryan Lortie [Mon, 17 Oct 2011 01:24:45 +0000 (21:24 -0400)]
gio static fixups

12 years agostatic and #include fixups in glib/
Ryan Lortie [Mon, 17 Oct 2011 01:17:10 +0000 (21:17 -0400)]
static and #include fixups in glib/

12 years agogenviron: #include fixups
Ryan Lortie [Mon, 17 Oct 2011 01:13:22 +0000 (21:13 -0400)]
genviron: #include fixups

12 years agomore 'static' adding in testcases
Ryan Lortie [Mon, 17 Oct 2011 01:11:11 +0000 (21:11 -0400)]
more 'static' adding in testcases

No dead code found this time...

12 years agocontexts test: don't use deprecated GCond wait API
Ryan Lortie [Mon, 17 Oct 2011 01:10:23 +0000 (21:10 -0400)]
contexts test: don't use deprecated GCond wait API

12 years agoMark some functions 'static' in glib/tests
Ryan Lortie [Mon, 17 Oct 2011 00:57:40 +0000 (20:57 -0400)]
Mark some functions 'static' in glib/tests

This has uncovered two unused testcases in option-context.c.  They are
currently broken and require more investigation (which is probably why
they are unused).

12 years agoUpdated Japanese translation
OKANO Takayoshi [Mon, 17 Oct 2011 00:25:08 +0000 (09:25 +0900)]
Updated Japanese translation

12 years agoREADME: Add note about gobject->gthread situation
Ryan Lortie [Sun, 16 Oct 2011 23:21:35 +0000 (19:21 -0400)]
README: Add note about gobject->gthread situation

12 years agogobject.pc: remove dependency on gthread
Ryan Lortie [Sun, 16 Oct 2011 23:17:52 +0000 (19:17 -0400)]
gobject.pc: remove dependency on gthread

GObject no longer uses gthread, so libgthread should no longer be
included in the linker flags of programs built against GObject.

12 years agodrop -uninstalled.pc files
Ryan Lortie [Sun, 16 Oct 2011 23:14:18 +0000 (19:14 -0400)]
drop -uninstalled.pc files

These were meant to provide the ability to use GLib directly out of its
build tree but have a couple of rather serious limitations that prevent
their serious use:

 - these files only worked with programs built using libtool

 - for non-trivial uses, other environment variables will need to be
   setup to allow GLib to function properly

 - the system doesn't stack well when attempting to use multiple
   libraries all uninstalled

The jhbuild --prefix= style system works much better in every way, so we
remove this old hack.

12 years agogitignore
Ryan Lortie [Sun, 16 Oct 2011 23:11:00 +0000 (19:11 -0400)]
gitignore

12 years agogthread: move test cases to glib/
Ryan Lortie [Sun, 16 Oct 2011 23:08:59 +0000 (19:08 -0400)]
gthread: move test cases to glib/

12 years agotests: merge gthread/ and glib/ atomic tests
Ryan Lortie [Sun, 16 Oct 2011 23:04:19 +0000 (19:04 -0400)]
tests: merge gthread/ and glib/ atomic tests

12 years agoglib/tests/atomic: convert to proper gtester test
Ryan Lortie [Sun, 16 Oct 2011 23:01:55 +0000 (19:01 -0400)]
glib/tests/atomic: convert to proper gtester test

12 years agoAlso clean up includes
Matthias Clasen [Sun, 16 Oct 2011 22:43:22 +0000 (18:43 -0400)]
Also clean up includes

12 years agoMove charset and locale name functions to their own files
Matthias Clasen [Sun, 16 Oct 2011 22:40:58 +0000 (18:40 -0400)]
Move charset and locale name functions to their own files

They did not really belong into either gutils or gutf8.

12 years agoAdd deprecation annotations to mem chunk apis
Matthias Clasen [Sun, 16 Oct 2011 21:37:29 +0000 (17:37 -0400)]
Add deprecation annotations to mem chunk apis

12 years agoMove version APIs out of gutils
Matthias Clasen [Sun, 16 Oct 2011 21:01:26 +0000 (17:01 -0400)]
Move version APIs out of gutils

Just another cleanup.

12 years agoMove GTrashStack out of gutils.[hc]
Matthias Clasen [Sun, 16 Oct 2011 20:52:24 +0000 (16:52 -0400)]
Move GTrashStack out of gutils.[hc]

Reducing the mess in gutils, and moving docs inline
at the same time. Double win.

12 years agoPass correct data to fatal log handlers
Matthias Clasen [Sun, 16 Oct 2011 20:23:18 +0000 (16:23 -0400)]
Pass correct data to fatal log handlers

This was pointed out by John Ralls in bug 653052.
He also provided the test case.

12 years agoClarify g_spawn_*() behaviour without full path
Martin Pitt [Wed, 17 Aug 2011 06:57:15 +0000 (08:57 +0200)]
Clarify g_spawn_*() behaviour without full path

Document the previously uncovered case of calling g_spawn_async_with_pipes()
without a full path but no G_SPAWN_SEARCH_PATH. This runs programs from the
current directory, which might be unexpected and even dangerous in some corner
cases.

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

12 years agoAdd a tests of some GVfs functions
Matthias Clasen [Sun, 16 Oct 2011 18:34:16 +0000 (14:34 -0400)]
Add a tests of some GVfs functions

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

12 years agoUpdated Japanese translation
Jiro Matsuzawa [Sun, 16 Oct 2011 16:54:33 +0000 (01:54 +0900)]
Updated Japanese translation

12 years agoUpdated Japanese translation
Jiro Matsuzawa [Sat, 17 Sep 2011 02:30:01 +0000 (11:30 +0900)]
Updated Japanese translation

12 years agoAdd app lauch environment test
Matthias Clasen [Sun, 16 Oct 2011 04:08:42 +0000 (00:08 -0400)]
Add app lauch environment test

12 years agoAdd g_get_codeset test
Matthias Clasen [Sun, 16 Oct 2011 03:58:30 +0000 (23:58 -0400)]
Add g_get_codeset test

12 years agoAdd GAsyncQueue unit test
Matthias Clasen [Sun, 16 Oct 2011 03:58:18 +0000 (23:58 -0400)]
Add GAsyncQueue unit test

12 years agoMove g_get_codeset next to g_get_charset
Matthias Clasen [Sun, 16 Oct 2011 03:27:28 +0000 (23:27 -0400)]
Move g_get_codeset next to g_get_charset

g_get_codeset is a close relatove to g_get_charset, and up to now
it lived a shadowy existence without any header presence.

12 years agoInclude genviron.h where necessary
Matthias Clasen [Sun, 16 Oct 2011 00:06:32 +0000 (20:06 -0400)]
Include genviron.h where necessary

12 years agoAnd fix the syntax, too
Matthias Clasen [Sat, 15 Oct 2011 23:39:14 +0000 (19:39 -0400)]
And fix the syntax, too

12 years agoForgotten file
Matthias Clasen [Sat, 15 Oct 2011 23:38:10 +0000 (19:38 -0400)]
Forgotten file

12 years agoDrop unused copy of _g_getenv_nomalloc
Matthias Clasen [Sat, 15 Oct 2011 22:23:07 +0000 (18:23 -0400)]
Drop unused  copy of _g_getenv_nomalloc

12 years agoGDBusConnection: warn that direct access to the stream is a bad idea
Simon McVittie [Thu, 13 Oct 2011 16:39:03 +0000 (17:39 +0100)]
GDBusConnection: warn that direct access to the stream is a bad idea

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=661679
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
12 years agoAdd two annotations to gio
Torsten Schönfeld [Tue, 16 Aug 2011 17:11:43 +0000 (19:11 +0200)]
Add two annotations to gio

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

12 years agoDocument that types are limited to 64 KiB
Simon McVittie [Tue, 4 Oct 2011 09:14:35 +0000 (10:14 +0100)]
Document that types are limited to 64 KiB

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=659916
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
12 years agoGIOModule: Use G_SEARCHPATH_SEPARATOR_S instead of ":"
Kean Johnston [Sat, 15 Oct 2011 21:57:23 +0000 (17:57 -0400)]
GIOModule: Use G_SEARCHPATH_SEPARATOR_S instead of ":"

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

12 years agoGKeyFile: improve introspection annotations
Giovanni Campagna [Sat, 15 Oct 2011 21:54:41 +0000 (17:54 -0400)]
GKeyFile: improve introspection annotations

Ensure that all methods that take or return arrays are annotated
(including length). Mark ref, unref and free methods as (skip).

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

12 years agoTurn GKeyFile into a boxed for introspection
Giovanni Campagna [Sat, 15 Oct 2011 21:51:25 +0000 (17:51 -0400)]
Turn GKeyFile into a boxed for introspection

Using the new refcounting API, introduce a boxed type wrapping
GKeyFile and expose it introspection bindings in glib-types.h.

12 years agoGKeyFile: Add refcounting API
Christian Persch [Mon, 25 May 2009 13:07:27 +0000 (15:07 +0200)]
GKeyFile: Add refcounting API

Adds g_key_file_ref and g_key_file_unref, to be used by a future
GKeyFile boxed type for language bindings.

Based on the patch by Christian Persch and Emmanuele Bassi.

Author: Christian Persch
Signed-off-by: Johan Dahlin
Signed-off-by: Giovanni Campagna
https://bugzilla.gnome.org/show_bug.cgi?id=590808

12 years agoAdd 'Since 2.32' indexes to gio and gobject docs
Matthias Clasen [Sat, 15 Oct 2011 21:31:47 +0000 (17:31 -0400)]
Add 'Since 2.32' indexes to gio and gobject docs

12 years agoGAppLaunchContext: add environment-manipulating functions
Dan Winship [Sat, 15 Oct 2011 20:59:59 +0000 (16:59 -0400)]
GAppLaunchContext: add environment-manipulating functions

Add functions for manipulating the environment under which a
GAppLaunchContext will launch its children, to avoid thread-related
bugs with using setenv() directly.

FIXME: win32 side isn't implemented yet

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

12 years agoMisc doc formatting fixes
Matthias Clasen [Sat, 15 Oct 2011 20:50:23 +0000 (16:50 -0400)]
Misc doc formatting fixes

12 years agoAdd tests for new g_environ_ functions
Matthias Clasen [Sat, 15 Oct 2011 20:28:07 +0000 (16:28 -0400)]
Add tests for new g_environ_ functions

12 years agoMove environment-related functions into their own files
Matthias Clasen [Sat, 15 Oct 2011 20:13:08 +0000 (16:13 -0400)]
Move environment-related functions into their own files

gutils.[hc] is a bit of a grab bag, so lets start cleaning
things up by moving all the environment-related functions
into separate genviron.[hc] files.

The private _g_getenv_nomalloc has been moved to its sole caller.

12 years agogutils: Add functions for working with environment arrays
Dan Winship [Sat, 15 Oct 2011 19:52:28 +0000 (15:52 -0400)]
gutils: Add functions for working with environment arrays

When spawning a child process, it is not safe to call setenv() before
the fork() (because setenv() isn't thread-safe), but it's also not
safe to call it after the fork() (because it's not async-signal-safe).
So the only safe way to alter the environment for a child process from
a threaded program is to pass a fully-formed envp array to
exec*/g_spawn*/etc.

So, add g_environ_getenv(), g_environ_setenv(), and
g_environ_unsetenv(), which act like their namesakes, but work on
arbitrary arrays rather than working directly on the environment.

http://bugzilla.gnome.org/show_bug.cgi?id=659326

12 years agoAdd to the pitfalls: fork() and daemon()
Ryan Lortie [Sat, 15 Oct 2011 17:27:46 +0000 (13:27 -0400)]
Add to the pitfalls: fork() and daemon()

12 years agotests/Makefile.am: remove unused LDFLAGS variable
Ryan Lortie [Sat, 15 Oct 2011 15:03:07 +0000 (11:03 -0400)]
tests/Makefile.am: remove unused LDFLAGS variable

12 years agoExpand thread docs a bit
Matthias Clasen [Sat, 15 Oct 2011 17:04:20 +0000 (13:04 -0400)]
Expand thread docs a bit

Add some discussion of pitfalls of threaded programming.

12 years agoDocumentation tweaks
Matthias Clasen [Sat, 15 Oct 2011 15:37:03 +0000 (11:37 -0400)]
Documentation tweaks

12 years agoUpdaged Galician translations
Fran Dieguez [Sat, 15 Oct 2011 14:29:50 +0000 (16:29 +0200)]
Updaged Galician translations

12 years agoCheck for "our" threads in some places
Ryan Lortie [Sat, 15 Oct 2011 13:48:42 +0000 (09:48 -0400)]
Check for "our" threads in some places

Don't allow g_thread_join() to be called on or g_thread_exit() to be
called from within threads that were not created by GLib.  Document
this.

12 years agogtk-doc g_thread_ref() and g_thread_unref()
Ryan Lortie [Sat, 15 Oct 2011 13:48:22 +0000 (09:48 -0400)]
gtk-doc g_thread_ref() and g_thread_unref()

12 years agoRename g_thread_try to g_thread_try_new
Ryan Lortie [Sat, 15 Oct 2011 13:48:10 +0000 (09:48 -0400)]
Rename g_thread_try to g_thread_try_new

12 years agoAdd atomic test to TEST_PROGS
Matthias Clasen [Sat, 15 Oct 2011 04:56:08 +0000 (00:56 -0400)]
Add atomic test to TEST_PROGS

12 years agoDocumentation additions
Matthias Clasen [Sat, 15 Oct 2011 04:26:02 +0000 (00:26 -0400)]
Documentation additions

12 years agoImprove test coverage
Matthias Clasen [Sat, 15 Oct 2011 04:09:20 +0000 (00:09 -0400)]
Improve test coverage

12 years agoAdd a test involving g_thread_ref/unref
Matthias Clasen [Sat, 15 Oct 2011 03:20:06 +0000 (23:20 -0400)]
Add a test involving g_thread_ref/unref

Also, fix the resource-limit test to properly unset RLIMIT_NPROC.

12 years agoAdd g_thread_try to the docs
Matthias Clasen [Sat, 15 Oct 2011 03:12:06 +0000 (23:12 -0400)]
Add g_thread_try to the docs

12 years agoUpdate doc lists
Matthias Clasen [Sat, 15 Oct 2011 03:01:05 +0000 (23:01 -0400)]
Update doc lists

12 years agoMinor doc clarifications
Matthias Clasen [Sat, 15 Oct 2011 03:00:17 +0000 (23:00 -0400)]
Minor doc clarifications

12 years agoMention thread API changes in README
Ryan Lortie [Sat, 15 Oct 2011 01:52:36 +0000 (21:52 -0400)]
Mention thread API changes in README

12 years agoI read the news today, oh boy...
Ryan Lortie [Sat, 15 Oct 2011 01:43:51 +0000 (21:43 -0400)]
I read the news today, oh boy...

12 years agoStop checking for fork() across GMainContext
Ryan Lortie [Fri, 14 Oct 2011 23:41:08 +0000 (19:41 -0400)]
Stop checking for fork() across GMainContext

01ed78d525cf2f8769022e27cc2573ec7ba123b3 introduced assertion checks for
creating a main context, forking, and attempting to use the main context
from the child side of the fork.

Some code (such as gnome-keyring-daemon) daemonise after calling
GMainContext.  That's probably still mostly safe since we still only
have one side of the fork touching the context afterwards.

This use case is still troubling, however, since if any worker threads
have been created at the time of the fork(), we could end up in the
classic situation of leaving some mutexes in a locked state when the
other threads disappear from the copy of the image that the child gets.

This will require some deeper thinking...

12 years agoMask all signals in GLib worker thread
Ryan Lortie [Fri, 14 Oct 2011 17:02:58 +0000 (13:02 -0400)]
Mask all signals in GLib worker thread

Some code using GLib (gnome-keyring-daemon, for example) assumes that
they can catch signals by masking them out in the main thread and
calling sigwait() from a worker.

The problem is that our new worker thread catches the signals before
sigwait() has a chance and the default action occurs (typically
resulting in program termination).

If we mask all the signals in our worker, then this can't happen.

12 years agodesktop-app-info: Add support for X-GNOME-Keywords
Florian Müllner [Thu, 13 Oct 2011 20:33:21 +0000 (22:33 +0200)]
desktop-app-info: Add support for X-GNOME-Keywords

With search gaining traction as being the preferred way to locate
applications, the existing .desktop file fields meant for browsing
often produce insufficient results.
gnome-control-center introduced a custom X-GNOME-Keywords field for
that purpose, which we plan to support in gnome-shell as well.

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

12 years agog_cond_timed_wait: support NULL time parameter
Ryan Lortie [Fri, 14 Oct 2011 04:00:14 +0000 (00:00 -0400)]
g_cond_timed_wait: support NULL time parameter

It was undocumented, but this used to mean "wait forever".  Looks like
we have some uses of this internally and there may be others in the
wild...

12 years agoGCond: use monotonic time for timed waits
Ryan Lortie [Fri, 14 Oct 2011 03:24:23 +0000 (23:24 -0400)]
GCond: use monotonic time for timed waits

Switch GCond to using monotonic time for timed waits by introducing a
new API based on monotonic time in a gint64: g_cond_wait_until().

Deprecate the old API based on wallclock time in a GTimeVal.

Fix up the gtk-doc for GCond while we're at it: update the examples to
use static-allocated GCond and GMutex and clarify some things a bit.
Also explain the rationale behind using an absolute time instead of a
relative time.

12 years agotests: disable deprecation warnings for tests
Ryan Lortie [Thu, 13 Oct 2011 14:51:35 +0000 (10:51 -0400)]
tests: disable deprecation warnings for tests

We need to test deprecated functions, so don't warn us for doing so.

12 years agogutils: stop using GStaticPrivate
Ryan Lortie [Thu, 13 Oct 2011 13:14:57 +0000 (09:14 -0400)]
gutils: stop using GStaticPrivate

This was our last internal use.

12 years agoRevert "make struct _GThread private"
Ryan Lortie [Thu, 13 Oct 2011 13:00:54 +0000 (09:00 -0400)]
Revert "make struct _GThread private"

This reverts commit d904612100120d12126f1a6623a106d8a5b02fa6.

glibmm touches the contents of GThread, so this broke their build.

12 years agomake struct _GThread private
Ryan Lortie [Thu, 13 Oct 2011 05:24:16 +0000 (01:24 -0400)]
make struct _GThread private

Hide the definition of struct _GThread in gthreadprivate.h for now.

This is possibly an API break -- although the structure contents were
undocumented and it was not safe to access them in a meaningful way,
someone may have tried to do it anyway.  We'll leave it here for a while
to see if it causes any problems.

Avoid merging its contents with GRealThread for now, just incase we need
to expose it again.

12 years agotidy up gthreadprivate.h
Ryan Lortie [Thu, 13 Oct 2011 05:22:51 +0000 (01:22 -0400)]
tidy up gthreadprivate.h

Remove some unused includes, too.

12 years agodrop g_thread_new_full()
Ryan Lortie [Thu, 13 Oct 2011 05:17:36 +0000 (01:17 -0400)]
drop g_thread_new_full()

We'll hold out on this until someone has a really convincing reason for
why they need to control the stack size.

If we do decide to add it back, it should probably have a name like
_new_with_stack_size(), not _full().

12 years agog_thread_new: never fail
Ryan Lortie [Thu, 13 Oct 2011 05:00:57 +0000 (01:00 -0400)]
g_thread_new: never fail

Remove the GError argument from g_thread_new() and abort on failure.
Introduce g_thread_try() for those who want to handle failure.

12 years agothread: nuke the concept of 'joinable'
Ryan Lortie [Thu, 13 Oct 2011 04:43:33 +0000 (00:43 -0400)]
thread: nuke the concept of 'joinable'

And remove the 'joinable' argument from g_thread_new() and
g_thread_new_full().

Change the wording in the docs.  Clarify expectations for
(deprecated) g_thread_create().

12 years agoGThread: make refcounting public
Ryan Lortie [Thu, 13 Oct 2011 04:29:04 +0000 (00:29 -0400)]
GThread: make refcounting public

12 years agothread: simplify 'free' process
Ryan Lortie [Thu, 13 Oct 2011 04:18:17 +0000 (00:18 -0400)]
thread: simplify 'free' process

GThread is freed using some very slightly confusing logic: if the thread
was created 'joinable', then the structure is freed after the join()
call succeeds (since we know the thread has exited).  If the thread was
not created 'joinable' then the free is when the thread quits (since we
know 'join' will not be called later).

Move to a straight ref-counting system: 1 ref owned by the thread and 1
extra ref if the thread is joinable.  Both thread quit and joining will
decrease the refcount by 1.

12 years agoremove 'joinable' parameter to backends
Ryan Lortie [Thu, 13 Oct 2011 04:01:28 +0000 (00:01 -0400)]
remove 'joinable' parameter to backends

Both backends are now oblivious to the concept of joinability, so don't
bother passing the parameter.

12 years agoposix threads: joinable tweaks
Ryan Lortie [Thu, 13 Oct 2011 03:40:02 +0000 (23:40 -0400)]
posix threads: joinable tweaks

Make the POSIX backend a little bit more like the win32 one in terms of
how we deal with joinability.

Calling g_system_thread_join() is now optional, and
g_system_thread_wait() can be safely called by multiple threads.

There is no longer any internal concept of joinability.

12 years agotests: don't #include <sys/resource.h> on win32
Ryan Lortie [Thu, 13 Oct 2011 03:25:12 +0000 (23:25 -0400)]
tests: don't #include <sys/resource.h> on win32

12 years agowin32 threads: simplify
Ryan Lortie [Thu, 13 Oct 2011 03:22:31 +0000 (23:22 -0400)]
win32 threads: simplify

Merge the GThreadData with the GThreadWin32 struct.  Drop the extra TLS
variable.

Close the handle on _free(), which means that there is no leak if
g_system_thread_join() isn't called.

Remove all internal concept of joinability.

12 years agoOnly g_system_thread_free() our own threads
Ryan Lortie [Thu, 13 Oct 2011 03:16:49 +0000 (23:16 -0400)]
Only g_system_thread_free() our own threads

Keep track of if we created a thread for ourselves or if the GThread*
was allocated in response to g_thread_self() on a previously-unknown
thread.

Only call g_system_thread_free() in the first case.

12 years agoFinish killing off GSystemThread
Ryan Lortie [Thu, 13 Oct 2011 03:04:15 +0000 (23:04 -0400)]
Finish killing off GSystemThread

12 years agowin32 threads: use our own data, not system_thread
Ryan Lortie [Thu, 13 Oct 2011 02:53:52 +0000 (22:53 -0400)]
win32 threads: use our own data, not system_thread

Stop using the generic system_thread field in GRealThread.  Use our own
pointer instead.

12 years agowin32: fix function name clash
Ryan Lortie [Thu, 13 Oct 2011 02:49:39 +0000 (22:49 -0400)]
win32: fix function name clash

12 years agoposix threads: use our own system_thread
Ryan Lortie [Thu, 13 Oct 2011 02:40:37 +0000 (22:40 -0400)]
posix threads: use our own system_thread

Wrap GRealThread in a GThreadPosix that includes its own pthread_t field
called "system_thread" and use that instead of the generic field in
GRealThread.

12 years agothread creation: Simplify error handling
Ryan Lortie [Thu, 13 Oct 2011 02:35:35 +0000 (22:35 -0400)]
thread creation: Simplify error handling

Instead of always returning non-NULL and finding out about errors via
the GError*, return NULL from the backend in the event of an error.

12 years agoCombine g_sytem_thread_{new,create}()
Ryan Lortie [Thu, 13 Oct 2011 02:29:13 +0000 (22:29 -0400)]
Combine g_sytem_thread_{new,create}()