Commit Graph

4094 Commits

Author SHA1 Message Date
Matthias Clasen
042954de9f Fix since tag 2011-12-10 21:49:10 -05:00
Ryan Lortie
a8927732c9 GDate: gtk-doc fixup 2011-12-10 14:09:54 -05:00
Philip Withnall
386bb0faad unicode: Fix a few issues with G_UNICHAR_MAX_DECOMPOSITION_LENGTH
Raised by Matthias in bgo#665685 but which I didn't spot until after pushing
commit 3ac7c35656.

Renames G_UNICHAR_MAX_DECOMPOSITION_LEN to G_UNICHAR_MAX_DECOMPOSITION_LENGTH
and fixes a few documentation issues.

See: bgo#665685
2011-12-06 19:41:31 +00:00
Philip Withnall
3ac7c35656 Bug 665685 — Add a #define for the max length of a Unicode decomposition
Add G_UNICHAR_MAX_DECOMPOSITION_LEN for the maximum length of the
decomposition of a single Unicode character.

Closes: bgo#665685
2011-12-06 19:09:01 +00:00
Behdad Esfahbod
10a154446c Minor doc fix. 2011-12-06 13:20:39 -05:00
Behdad Esfahbod
91fb373d55 Minor 2011-12-06 13:19:27 -05:00
Philip Withnall
22da18fa70 GVariant: add preconditions to ref. counting functions
These prevent GVariants from accidentally being brought back to life after
being freed, and should make it easier to track down ref. counting issues.

Closes: bgo#665184
2011-12-02 10:23:14 +00:00
Matthias Clasen
b13e79da62 Don't abort if g_ascii_strtod tests fail
https://bugzilla.gnome.org/show_bug.cgi?id=652560
2011-11-29 22:54:45 -05:00
Geek87
22748dbbc9 Remove two useless lines of code
https://bugzilla.gnome.org/show_bug.cgi?id=648516
2011-11-29 22:16:53 -05:00
Geek87
27e70806c1 Fix a little comment error in the _GTreeNode struct
https://bugzilla.gnome.org/show_bug.cgi?id=648516
2011-11-29 22:16:52 -05:00
Carlos Garcia Campos
4ce5a11daf gtester: Add command line option to skip tests
https://bugzilla.gnome.org/show_bug.cgi?id=664809
2011-11-27 14:33:47 +01:00
Stef Walter
fcc69fd318 GBytes: A new type for an immutable set of bytes.
* Represents an immutable reference counted block of memory.
 * This is basically the internal glib GBuffer structure exposed,
   renamed, and with some additional capabilities.
 * The GBytes name comes from python3's immutable 'bytes' type
 * GBytes can be safely used as keys in hash tables, and have
   functions for doing so: g_bytes_hash, g_bytes_equal
 * GByteArray is a mutable form of GBytes, and vice versa. There
   are functions for converting from one to the other efficiently:
   g_bytes_unref_to_array() and g_byte_array_free_to_bytes()
 * Adds g_byte_array_new_take() to support above functions

https://bugzilla.gnome.org/show_bug.cgi?id=663291
2011-11-24 08:58:38 +01:00
Matthias Clasen
1b01109377 Add some more mainloop tests 2011-11-22 23:57:18 -05:00
Matthias Clasen
d0e2865a2e Remove unnecessary includes
These were meant for some other test that ended up not getting
added. This fixes bug 664559.
2011-11-22 19:31:30 -05:00
Matthias Clasen
6dde6b7f21 Add back required _XOPEN_SOURCE define
This got lost somewhere between 2.30 and now, but it is needed
for isnan(). See bug 664354, reported by Tim Mooney.
2011-11-22 19:12:48 -05:00
Ryan Lortie
0f1fb417bf Missed a couple of @returns 2011-11-21 11:39:52 -05:00
Ryan Lortie
0e0554bd62 GVariant: drop use of @returns 2011-11-21 11:33:21 -05:00
Matthias Clasen
4527e7cbf7 gbitlock: Drop @returns syntax from doc comments 2011-11-21 11:09:42 -05:00
Matthias Clasen
22d3972284 GBuffer: Drop @returns syntax from doc comments 2011-11-21 11:05:43 -05:00
Matthias Clasen
ef4ae742ce Improve test coverage 2011-11-21 01:53:29 -05:00
Matthias Clasen
89ad8bda23 Improve mainloop test coverage slightly 2011-11-21 01:40:51 -05:00
Matthias Clasen
b0fa096870 Improve test coverage 2011-11-21 01:02:50 -05:00
Matthias Clasen
0fd14b1a56 Fix a case conversion bug
For titlecase chars without uppercase variant, we were returning
0, contrary to the docs.
2011-11-21 00:28:41 -05:00
Matthias Clasen
5197870665 Improve test coverage 2011-11-21 00:28:41 -05:00
Matthias Clasen
4cbacb91de Add a test for g_unichar_isdefined 2011-11-21 00:28:41 -05:00
Josselin Mouette
ff2f4a12ee Document that g_list_sort is a stable sort.
This is a guarantee for the future so that applications can rely on it.

https://bugzilla.gnome.org/show_bug.cgi?id=531973
2011-11-20 16:53:36 +01:00
Giovanni Campagna
d2fd6dac4a GMain: allow NULL context to g_source_attach
Documentation says it's fine and means default context, but the annotations
are missing (and thus bindings would complain).

https://bugzilla.gnome.org/show_bug.cgi?id=664302
2011-11-18 15:21:17 +01:00
Jürg Billeter
fcffe6abbb GKeyFile: Accept empty files
It already accepts files consisting solely of whitespace.

https://bugzilla.gnome.org/show_bug.cgi?id=663432
2011-11-17 23:11:41 -05:00
Simon McVittie
a0c755710c Document exactly what g_time_val_to_iso8601() produces
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=537637
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-11-17 23:11:01 -05:00
Matthias Clasen
1a08591c3a Deal gracefully with NULL log domains 2011-11-16 21:42:28 -05:00
Alexander Larsson
3a7960f757 win32: Make g_get_monotonic_clock lockless 2011-11-16 09:10:46 +01:00
Alexander Larsson
8d023c2706 win32: Use timeGetTime as monotonic base
This allows apps that need it to increase timer accuracy
using timeBeginPeriod
2011-11-16 09:10:46 +01:00
Alexander Larsson
64dec8ad9f win32: Add a monotonic timer 2011-11-16 09:10:45 +01:00
Sjoerd Simons
469e1a15a0 Fix 1bit mutex test on platforms with 32 bit aligned pointers
The 1 bit mutex tests asserts: ((gsize) ptrs) % 8, ==, 0), which fails
when the platform only aligns porters to 32 bits (e.g. S390 and
powerpc).

I'm not sure why this assertion was placed here, but given
that internally g_pointer_bit_trylock uses g_atomic_int_or internally
change the assertion so it only requires the alignment to be a multiple
of sizeof(int)
2011-11-15 09:27:00 +01:00
Matthias Clasen
65eb65b777 Avoid unused variable warnings in g_ascii_strtod 2011-11-14 23:30:18 -05:00
Matthias Clasen
7c0ee79e34 GThread: handle thread names safely
Avoid a race condition where the string may be freed before
the new thread got around to using it. Also add a test for
thread names.

https://bugzilla.gnome.org/show_bug.cgi?id=663381
2011-11-14 22:18:13 -05:00
Matthias Clasen
3f0d275295 Move remaining docs inline
This introduces a fake source file just for holding
docs that have no good place elsewhere. Not great, but
better than templates.
2011-11-14 21:22:46 -05:00
Matthias Clasen
2195e20dce Move GDate docs inline 2011-11-14 21:22:46 -05:00
Matthias Clasen
18da6e6be9 Move i18n docs inline 2011-11-14 21:22:46 -05:00
Matthias Clasen
c8b0617a2b Move slice and hook docs inline 2011-11-14 21:22:37 -05:00
Dan Winship
29f786851d Fix glib/tests/utils for g_parse_debug_string() changes 2011-11-14 13:55:14 -05:00
Matthias Clasen
06bb6c75a2 More consistent doc formatting
Move some things around, make capitalization of short descriptions
more consistent.
2011-11-12 21:54:42 -05:00
Matthias Clasen
599f254066 Cleanups to debug env var handling 2011-11-12 19:13:44 -05:00
Matthias Clasen
943a18b564 Parse G_DEBUG only once 2011-11-12 18:36:52 -05:00
Matthias Clasen
5d9f05eef1 glib-unix.h: Add G_BEGIN/END_DECLS
The omission was pointed out in bug 663880.
2011-11-12 10:32:35 -05:00
Chun-wei Fan
faebf0f653 gstrfuncs.c: Fix variable declaration
Declare variables at top of block to stop C89 compilers from complaining.
2011-11-12 10:38:31 +08:00
Kristian Rietveld
f218353e04 Need to include xlocale.h on Darwin for strtod_l
This fixes the build of gstrfuncs.c on Darwin.
2011-11-09 08:32:33 +01:00
Benjamin Otte
7d1c7af1a6 docs: Improve g_variant_loop() docs
Typo fix and changing "is not recommended" to the nice version of "don't
do this", aka "causes undefined behavior".
2011-11-07 15:29:51 +01:00
Benjamin Otte
14677e16d8 docs: Tell which function to use to avoid errors. 2011-11-07 15:29:51 +01:00
Alexander Larsson
41b8ce7100 win32: Remove some debug spew on startup
This is not needed anymore and was causing problems for pkg-config.
2011-11-03 17:27:08 +01:00
Matthias Clasen
d2d62ecfcd Make the default log handler more useful
We make the default log handler only print default and informational
messages if the log domain is explicitly requested.

https://bugzilla.gnome.org/show_bug.cgi?id=661926
2011-11-03 01:50:29 -04:00
Matthias Clasen
7456b43c3e Move old deprecated gmain api into deprecated/ 2011-11-03 00:39:31 -04:00
Matthias Clasen
a3c8712c4b Remove single-include guards in deprecated/
Not allowed to include these headers single anymore, either.
2011-11-03 00:31:14 -04:00
Matthias Clasen
03766a1a38 Don't use G_DISABLE_DEPRECATED guards around deprecated functions
I'm leaving the old-style deprecation guards in place around
deprecated macros, enumeration values, etc, for now.
2011-11-03 00:04:15 -04:00
Ryan Lortie
4c038429b1 Revert "gthread: G_STATIC_MUTEX_INIT: Fix this for the non-win32 case."
This reverts commit 52fd106724.
2011-10-26 15:10:33 -04:00
Murray Cumming
52fd106724 gthread: G_STATIC_MUTEX_INIT: Fix this for the non-win32 case.
Also initialize the unused member. This was correct before but
was broken when the ifndef was moved inside the GStaticMutex
struct:
http://git.gnome.org/browse/glib/commit/glib/gthread.h?id=24652730a9faaedb19b9e90024077eb7f75a6907
This avoids a compiler warning.
2011-10-26 12:11:58 +02:00
Will Thompson
5e2a2ef288 g_parse_debug_string: invert flags given besides "all"
Any flags specified as well as "all" are subtracted from the result,
allowing the user to specify FOO_DEBUG="all,bar,baz" to mean "give me
debugging information for everything except bar and baz".

https://bugzilla.gnome.org/show_bug.cgi?id=642452
2011-10-24 20:35:30 -04:00
Matthias Clasen
73e3c98df0 Fix g_hash_table_iter_replace
When reusing an existing key 'internally', we must avoid calling
the key_destroy function on the old key.

https://bugzilla.gnome.org/show_bug.cgi?id=662544
2011-10-24 13:29:17 -04:00
Matthias Clasen
e52437982c Make g_ascii_strtod behave as documented
The docs explicitly state that we reset errno, so lets do that,
even if we just wrap strtod_l. Also move the argument check
out of the ifdef.

https://bugzilla.gnome.org/show_bug.cgi?id=662398
2011-10-21 15:00:14 -04:00
Matthias Clasen
269acbe703 Deprecate g_atexit
This function was just not a good idea to begin with.
Its documentation gives plenty of reason not to use it.
2011-10-19 21:03:43 -04:00
Ryan Lortie
2a98cc635e The usual docs unbreaking... 2011-10-19 15:07:22 -04:00
Ryan Lortie
99f0eaa4c5 Fix bug in g_static_rec_mutex_unlock_full()
pthreads doesn't implement the _lock_full() and _unlock_full() calls on
recursive mutexes so we don't have it on GRecMutex either.  Now that
we're using GRecMutex to implement GStaticRecMutex, we have to fake it
by keeping an internal counter of the number of locks and calling
g_rec_mutex_unlock() the appropriate number of times.

The code to do this looked like:

  depth = mutex->depth;
  while (mutex->depth--)
    g_rec_mutex_unlock (rm);
  return depth;

which unfortunately did one last decrement after mutex->depth was
already zero (leaving it equal to -1).

When locked the next time, the count would then increase from -1 to 0
and then the next _unlock_full() call would not do any calls to
g_rec_mutex_unlock(), leading to a deadlock.

https://bugzilla.gnome.org/show_bug.cgi?id=661914
2011-10-18 23:26:00 -04:00
Ryan Lortie
aba0f0c38b gatomic: introduce G_ATOMIC_LOCK_FREE
We clean up the detection of if we should do 'real' atomic operations or
mutex-emulated ones with the introduction of a new (public) macro:
G_ATOMIC_LOCK_FREE.  If defined, our atomic operations are guaranteed to
be done in hardware.

We need to use __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 to determine if our
compiler supports GCC-style atomic operations from the gatomic.h header
because we might be building a program against GLib using a different
set of compiler options (or a different compiler) than was used to build
GLib itself.

Unfortunately, this macro is not available on clang, so it has currently
regressed to using the mutex emulation.  A bug about that has been
opened here:

  http://llvm.org/bugs/show_bug.cgi?id=11174
2011-10-18 16:45:28 -04:00
Ryan Lortie
c9b6c3c85a gatomic: cast to the correct pointer sign
In the fallback case of the g_atomic_int_ macros we had some (gint*)
casts that should have been (guint*) casts.
2011-10-18 16:45:28 -04:00
Alexander Larsson
cf3f1b026b Actually Don't define GLIB_COMPILATION in libgthread
Last commit was wrong, fixing it up
2011-10-18 14:15:07 +02:00
Alexander Larsson
be770969e9 Don't define GLIB_COMPILATION in libgthread
This was turning all the GLIB_VARs in the glib headers into
dllexports on windows, causing all sort of nastiness. libgthread is
mostly empty now anyway, so we don't need any GLIB_COMPILATION like
flag.
2011-10-18 13:34:06 +02:00
Matthias Clasen
735420e546 Fix an include guard mismatch
Spotted by Colin Walters.
2011-10-17 17:01:36 -04:00
Chun-wei Fan
f3ac581713 Move _glib_get_locale_dir to ggettext.c
-Move _glib_get_locale_dir to ggettext.c, as Matthias suggested
-Made up for the headers that needed to be included in ggettext.c to avoid
 C4013 (implicit declaration of ...) errors/warnings
2011-10-18 01:01:02 +08:00
Chun-wei Fan
b25177fc4f GLib: Add forgotten includes and build fixes
-gcharset.c, genviron.c, gunicollate.c: Some headers were missed in those
 files that triggered C4013 warnings/errors (aka. implicit declaration
 of ... in GCC).  Make up for them here.
-gwin32.h: Only define g_win32_get_package_installation_directory/
 g_win32_get_package_installation_subdirectory as macros
 (alias of g_win32_get_package_installation_directory_utf8/
 g_win32_get_package_installation_subdirectory_utf8) on Win64 (x64) as
 g_win32_get_package_installation_directory/
 g_win32_get_package_installation_subdirectory have seperate existing
 implmentations for Win32-this is a long-standing problem but was covered-
 up by G_DISABLE_DEPRECATED, which we are stopping to use as of 2.31.0.
2011-10-17 23:54:05 +08:00
Ryan Lortie
e5fd0f5df6 Revert "Bug 652827 - glib-2.29.8 no longer builds with mingw.org's toolchain"
This reverts commit 3492122112.
2011-10-17 10:55:02 -04:00
Chun-wei Fan
e192f45a93 glib/tests/thread.c: Add config guards
Not all systems come with unistd.h and sys/time.h, so use config guards
on them so that they are only included when available.
2011-10-17 17:18:20 +08:00
Matthias Clasen
2f71118e78 More include cleanups 2011-10-17 02:14:39 -04:00
Matthias Clasen
0ec3c744c4 include cleanup 2011-10-17 01:59:35 -04:00
Matthias Clasen
d9053e026c Make things compile again 2011-10-17 01:52:10 -04:00
Matthias Clasen
08933846e4 Move gettext variations into their own files 2011-10-17 01:50:00 -04:00
Matthias Clasen
67bf0083db Reshuffle some functions between gutils and gfileutils
Move filename-related functions to gfileutils, and move
size formatting functions to gutils.
2011-10-17 01:30:31 -04:00
Matthias Clasen
23afdb119e include cleanup 2011-10-17 01:30:09 -04:00
Matthias Clasen
f8a7471308 Trivial 2011-10-17 01:11:56 -04:00
Matthias Clasen
fbe24cab21 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
2011-10-17 00:39:43 -04:00
Ryan Lortie
b0ab7aba6b 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.
2011-10-16 21:59:55 -04:00
Ryan Lortie
a6d9cf3380 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.
2011-10-16 21:50:26 -04:00
Ryan Lortie
3eec796b18 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.
2011-10-16 21:41:15 -04:00
Ryan Lortie
740eacbfca static and #include fixups in glib/ 2011-10-16 21:41:15 -04:00
Ryan Lortie
1b018a8bb2 genviron: #include fixups 2011-10-16 21:41:15 -04:00
Ryan Lortie
3d93c44374 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).
2011-10-16 21:41:15 -04:00
Ryan Lortie
c5aa8390b2 gitignore 2011-10-16 19:11:00 -04:00
Ryan Lortie
a9a1c97904 gthread: move test cases to glib/ 2011-10-16 19:08:59 -04:00
Ryan Lortie
fb4e120d88 tests: merge gthread/ and glib/ atomic tests 2011-10-16 19:04:19 -04:00
Ryan Lortie
f5e8694782 glib/tests/atomic: convert to proper gtester test 2011-10-16 19:01:55 -04:00
Matthias Clasen
6c1d768f7b Also clean up includes 2011-10-16 18:43:22 -04:00
Matthias Clasen
0589f715e5 Move charset and locale name functions to their own files
They did not really belong into either gutils or gutf8.
2011-10-16 18:40:58 -04:00
Matthias Clasen
86cc4b246d Add deprecation annotations to mem chunk apis 2011-10-16 17:37:29 -04:00
Matthias Clasen
e7b4319d61 Move version APIs out of gutils
Just another cleanup.
2011-10-16 17:01:26 -04:00
Matthias Clasen
45f221c32f Move GTrashStack out of gutils.[hc]
Reducing the mess in gutils, and moving docs inline
at the same time. Double win.
2011-10-16 16:52:24 -04:00
Matthias Clasen
6ab1c77270 Pass correct data to fatal log handlers
This was pointed out by John Ralls in bug 653052.
He also provided the test case.
2011-10-16 16:24:20 -04:00
Martin Pitt
1435db48ba 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
2011-10-16 16:09:33 -04:00
Matthias Clasen
cbb0b2a0ed Add g_get_codeset test 2011-10-15 23:58:30 -04:00
Matthias Clasen
1493285f1d Add GAsyncQueue unit test 2011-10-15 23:58:18 -04:00
Matthias Clasen
d0bb1e0b0a 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.
2011-10-15 23:27:28 -04:00
Matthias Clasen
976b0b72a4 Include genviron.h where necessary 2011-10-15 20:06:32 -04:00
Matthias Clasen
327e72f9fb And fix the syntax, too 2011-10-15 19:39:14 -04:00
Matthias Clasen
7df9637f0f Forgotten file 2011-10-15 19:38:10 -04:00
Matthias Clasen
d4dfca21bb Drop unused copy of _g_getenv_nomalloc 2011-10-15 18:23:07 -04:00
Giovanni Campagna
94accc2d78 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
2011-10-15 17:54:41 -04:00
Christian Persch
a57c9148cf 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
2011-10-15 17:44:45 -04:00
Matthias Clasen
117e534091 Misc doc formatting fixes 2011-10-15 17:00:56 -04:00
Matthias Clasen
94c246e8e3 Add tests for new g_environ_ functions 2011-10-15 16:28:07 -04:00
Matthias Clasen
7a9987d35d 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.
2011-10-15 16:13:08 -04:00
Dan Winship
409d93148f 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
2011-10-15 15:54:45 -04:00
Ryan Lortie
5ff803d91f Add to the pitfalls: fork() and daemon() 2011-10-15 13:27:46 -04:00
Matthias Clasen
6651bd221e Expand thread docs a bit
Add some discussion of pitfalls of threaded programming.
2011-10-15 13:04:20 -04:00
Matthias Clasen
e4699af8eb Documentation tweaks 2011-10-15 11:37:03 -04:00
Ryan Lortie
3fe3fdd75a 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.
2011-10-15 09:48:42 -04:00
Ryan Lortie
11f3684b71 gtk-doc g_thread_ref() and g_thread_unref() 2011-10-15 09:48:22 -04:00
Ryan Lortie
e75e9c3044 Rename g_thread_try to g_thread_try_new 2011-10-15 09:48:10 -04:00
Matthias Clasen
4417e77f17 Add atomic test to TEST_PROGS 2011-10-15 00:56:08 -04:00
Matthias Clasen
482bb38748 Documentation additions 2011-10-15 00:26:02 -04:00
Matthias Clasen
8bc8cd7aa0 Improve test coverage 2011-10-15 00:09:20 -04:00
Matthias Clasen
52321def8f Add a test involving g_thread_ref/unref
Also, fix the resource-limit test to properly unset RLIMIT_NPROC.
2011-10-14 23:20:06 -04:00
Matthias Clasen
5ddcc284e8 Minor doc clarifications 2011-10-14 23:00:17 -04:00
Ryan Lortie
7ab25865f2 Stop checking for fork() across GMainContext
01ed78d525 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...
2011-10-14 20:01:22 -04:00
Ryan Lortie
51773c6c64 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.
2011-10-14 20:01:22 -04:00
Ryan Lortie
14e3b12823 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...
2011-10-14 00:00:14 -04:00
Ryan Lortie
4033c616ff 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.
2011-10-13 23:44:17 -04:00
Ryan Lortie
3ebdb4d46a gutils: stop using GStaticPrivate
This was our last internal use.
2011-10-13 09:14:57 -04:00
Ryan Lortie
62fe053268 Revert "make struct _GThread private"
This reverts commit d904612100.

glibmm touches the contents of GThread, so this broke their build.
2011-10-13 09:00:54 -04:00
Ryan Lortie
d904612100 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.
2011-10-13 01:34:08 -04:00
Ryan Lortie
b1cc2579c1 tidy up gthreadprivate.h
Remove some unused includes, too.
2011-10-13 01:22:51 -04:00
Ryan Lortie
332f74a2fc 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().
2011-10-13 01:17:36 -04:00
Ryan Lortie
430c5635f2 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.
2011-10-13 01:00:57 -04:00
Ryan Lortie
015f4b4513 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().
2011-10-13 00:43:33 -04:00
Ryan Lortie
b0e73ca390 GThread: make refcounting public 2011-10-13 00:29:04 -04:00
Ryan Lortie
62be9365d9 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.
2011-10-13 00:18:17 -04:00
Ryan Lortie
becb4b820f remove 'joinable' parameter to backends
Both backends are now oblivious to the concept of joinability, so don't
bother passing the parameter.
2011-10-13 00:01:28 -04:00
Ryan Lortie
dbf20d585f 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.
2011-10-12 23:40:02 -04:00
Ryan Lortie
f970dfc734 tests: don't #include <sys/resource.h> on win32 2011-10-12 23:25:12 -04:00
Ryan Lortie
45736d33bb 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.
2011-10-12 23:22:31 -04:00
Ryan Lortie
dfd466979b 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.
2011-10-12 23:19:06 -04:00
Ryan Lortie
a5800ef336 Finish killing off GSystemThread 2011-10-12 23:04:15 -04:00
Ryan Lortie
e0c9757b9b win32 threads: use our own data, not system_thread
Stop using the generic system_thread field in GRealThread.  Use our own
pointer instead.
2011-10-12 22:53:52 -04:00
Ryan Lortie
67e28068e1 win32: fix function name clash 2011-10-12 22:49:39 -04:00
Ryan Lortie
2010f7f955 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.
2011-10-12 22:43:22 -04:00
Ryan Lortie
2f5486f020 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.
2011-10-12 22:43:22 -04:00
Ryan Lortie
e14a3746db Combine g_sytem_thread_{new,create}() 2011-10-12 22:43:22 -04:00
Ryan Lortie
a3f82c847f g_system_thread_create: drop 'data' arg
Since it's now always the same as the 'thread' arg.
2011-10-12 22:43:22 -04:00
Ryan Lortie
3237eaf5d5 g_system_thread_create: SystemThread -> RealThread
Just like g_system_thread_wait().
2011-10-12 22:43:22 -04:00
Matthias Clasen
6613b2f8fd Move more docs inline 2011-10-12 22:29:53 -04:00
Ryan Lortie
dc3727cc5f g_system_thread_join: rename to _wait() 2011-10-12 22:15:46 -04:00
Ryan Lortie
4bb968e335 g_system_thread_join: take GRealThread *
Make g_system_thread_join take the GRealThread* instead of a
GSystemThread.
2011-10-12 22:14:38 -04:00
Ryan Lortie
e064c9bfec thread: delegate allocation of GThread to backends
Add g_system_thread_new() and g_system_thread_free(), implemented with
GSlice.  Use those instead of g_new() and g_free().

Presently, the backends are both doing the same thing.  This will change
soon.
2011-10-12 22:04:39 -04:00
Matthias Clasen
75ea14e885 Move GScanner docs inline 2011-10-12 21:49:44 -04:00
Ryan Lortie
d537726ded thread: stop sharing g_once_mutex
Unrelated code shouldn't be sharing the same mutex for no good reason --
particularly not across a file boundary.
2011-10-12 21:48:02 -04:00
Ryan Lortie
8cff9c57b1 thread: drop thread setup function hackery
Use a custom proxy function for the deprecated case instead.

Now GRealThread has strictly zero members dedicated to deprecated
functionality.
2011-10-12 21:48:02 -04:00
Matthias Clasen
2da83bbd36 Deprecate GCache
Ryan said it would be 'deprecated soon in GLib', when he removed
the use of this in GTK+. That was a year ago, so its about time
we act on it.
2011-10-12 19:55:02 -04:00
Ryan Lortie
39ae59c47e thread: Delete g_system_thread_self()
It's no longer used for anything at all.
2011-10-12 18:35:45 -04:00
Ryan Lortie
a90a4b967f thread: reduce use of system_thread
The use of system_thread is now limited to joining.  We don't do that
for threads that we didn't create for ourselves, so we don't need to
call g_system_thread_self() to fill in system_thread for those.
2011-10-12 18:33:07 -04:00
Ryan Lortie
b7f0506371 thread: hide g_static_rec_mutex_get_rec_mutex_impl
Unlike with GStaticMutex, this function was never part of the pre-2.32
ABI, so we should keep it tucked in.
2011-10-12 18:27:06 -04:00
Ryan Lortie
1f34ef4117 missed from last commit 2011-10-12 18:25:40 -04:00
Ryan Lortie
47e20ed3ac thread: remove GSystemThread assign/equal
These are no longer in use.
2011-10-12 18:24:48 -04:00
Ryan Lortie
903705edf2 thread: remove dead decl from gthreadprivate.h
This function hasn't existed for a while...
2011-10-12 18:23:20 -04:00
Ryan Lortie
ed35d2719b thread: Remove the zero_thread
This was only used for redundant assertion checks.
2011-10-12 18:22:31 -04:00
Ryan Lortie
2b281e40f3 GStaticRecMutex: implement via GRecMutex
Instead of doing our own hacked-up version.

This also reduces use of GSystemThread.
2011-10-12 18:18:16 -04:00
Ryan Lortie
96904b6790 thread: use GSList for g_thread_foreach list
...instead of having a 'next' pointer in the GThread struct.

Now GThread contains no fields used only by deprecated code (except for
the rather generic setup function field).
2011-10-12 17:05:50 -04:00
Ryan Lortie
9ca4f14264 thread: call g_enumerable_thread_add via callback
There are no longer any functions defined in gthread-deprecated.c called
from gthread.c.
2011-10-12 17:05:50 -04:00
Ryan Lortie
f788a2e5e1 thread: use GPrivate for enumerable threads
Use a GPrivate to track the destruction of enumerable threads and remove
them from the list.
2011-10-12 17:05:50 -04:00
Colin Walters
1368533dc2 gvariant: Doc typo fix 2011-10-12 15:25:12 -04:00
Colin Walters
15b9f64004 gvariant: Briefly mention limits 2011-10-12 15:23:39 -04:00
Dan Winship
0af48a5d7b gthread-deprecated: add a mising "static" to a method 2011-10-12 13:59:33 -04:00
Dan Winship
71cf70b39c Simplify checks for CLOCK_MONOTONIC
Remove the complicated configure-time and runtime checks, and just use
CLOCK_MONOTONIC if it's defined.

https://bugzilla.gnome.org/show_bug.cgi?id=661421
2011-10-12 08:59:35 -04:00
Matthias Clasen
daede1dc27 Disable deprecations where appropriate in tests 2011-10-12 00:48:18 -04:00
Matthias Clasen
bcdb865c59 Disable deprecations where appropriate in tests 2011-10-12 00:37:02 -04:00
Matthias Clasen
7455dd370e Make single includes mandatory
This has been the official line since 2.17, which seems plenty
long enough for a transition phase.
2011-10-12 00:25:38 -04:00
Ryan Lortie
9bb5a55bda GStaticPrivate: implement via GPrivate
Thanks to the modifications in 3d4846d923,
GStaticPrivate is not so directly tied in with GThread anymore.  It is
now a simple matter to cut it out completely by using a GPrivate to
store the GArray instead of storing it in the GThread.
2011-10-12 00:17:49 -04:00
Matthias Clasen
3d282dcc2e Silence deprecations in deprecated/ (again) 2011-10-11 23:44:43 -04:00
Chun-wei Fan
36ccdab760 Bug 661438: Fix up gmacros.h a bit
The macro here should be G_DEPRECATED, not G_GNUC_DEPRECATED.
2011-10-12 10:38:47 +08:00
Dan Winship
380ec80d07 g_time_val_from_iso8601: clarify the docs a bit 2011-10-11 19:28:59 -04:00
Ryan Lortie
baa394910b gmain: use GPrivate instead of GStaticPrivate 2011-10-11 18:42:03 -04:00
Dan Winship
b3e3914062 Fix two tests for G_DEBUG=gc-friendly 2011-10-11 15:36:42 -04:00
Chun-wei Fan
08d6e1147d Use GLIB_DEPRECATED instead of G_GNUC_DEPRECATED in our headers
This will let others opt out of seeing GLib deprecation warnings
by defining GLIB_DISABLE_DEPRECATION_WARNINGS.

https://bugzilla.gnome.org/show_bug.cgi?id=661438
2011-10-11 13:42:59 -04:00
Matthias Clasen
a1acf35653 Add our own deprecation macros
This will allow to suppress deprecation warnings on a per-module
basis, if needed. They are on by default now, though.
2011-10-11 13:42:58 -04:00
Matthias Clasen
0da0411a4a Add better deprecation macros
Unlike G_GNUC_... macros, the new G_DEPRECATED[_FOR] are
meant as abstractions that work with different compilers.
Using a new name also lets us restrict it to 'must be placed
before the declaration', which works with more compilers.

https://bugzilla.gnome.org/show_bug.cgi?id=661438
2011-10-11 13:13:27 -04:00
Chun-wei Fan
0e71214bef glibconfig.win32(.in): Cleanup cruft
The definitions of _GMutex* and G_STATIC_MUTEX_INIT is now found in
glib/deprecated/gthread.h, and should no longer be in the mainline
code, so remove them from here.
2011-10-11 15:55:55 +08:00
Ryan Lortie
3e5a30fc17 GStaticMutex: ABI fixup
Everything was OK as long as GMutex was backed by pthread_mutex_t on
POSIX.  Since this is no longer the case, the ABI of GStaticMutex was
broken.

Fix that up by using pthread_mutex_t directly in the structure.  Since
that's potentially incompatible with our GMutex implementation, set
g_thread_use_default_impl to FALSE to cause the fallback code (which
manually allocates a GMutex) to run, even in the case of
already-existing code (without the need for a recompile).  This will
cause the pthread_mutex_t part of the struct to be completely ignored.
2011-10-10 19:44:23 -04:00
Matthias Clasen
2c1cbde21e Compile private test with -pthread on UNIX
We are using explicit pthread calls here, so we should
use the right linker flags for that.

https://bugzilla.gnome.org/show_bug.cgi?id=661318
2011-10-10 11:11:29 -04:00
Matthias Clasen
5e2764d70c Silence deprecation warnings in deprecated/
We know we are all deprecated here...
2011-10-09 09:57:13 -04:00
Matthias Clasen
f9b29ca034 Add G_GNUC_DEPRECATED to deprecated APIs in glib 2011-10-08 23:16:01 -04:00
Matthias Clasen
30b320b61c Add some GHookList tests 2011-10-08 19:02:06 -04:00
Matthias Clasen
6109db27ae Test a few more GIOChannel functions 2011-10-08 19:02:06 -04:00
Matthias Clasen
d33f625444 Remove a bit of dead code 2011-10-08 19:02:06 -04:00
Matthias Clasen
d5a1ca8fd7 Add some more GMarkup tests 2011-10-08 19:02:06 -04:00
Matthias Clasen
08e17ae51b Call setlocale in markup-parse test
This is necessary to make utf-8 text come out properly.
2011-10-08 19:02:06 -04:00
Matthias Clasen
87cb246f46 Improve GNode test coverage 2011-10-08 19:02:05 -04:00
Matthias Clasen
dca6a601c1 Improve GCache test coverage 2011-10-08 19:02:05 -04:00
Matthias Clasen
eeedaac3e8 Improve coverage of string function tests 2011-10-08 19:02:05 -04:00
Matthias Clasen
944f66f38f Improve coverage of GHmac tests 2011-10-08 19:02:05 -04:00
Matthias Clasen
d9e9239a46 Add a test for g_date_time_new_from_timeval_utc 2011-10-08 19:02:05 -04:00
John Ralls
edcac1ee41 Bug 661129: Duplicate symbols zero_thread and g_once_mutex on OSX 2011-10-07 09:51:12 -07:00
Dan Winship
59f1f54655 Add g_main_context_ref_thread_default()
Add g_main_context_ref_thread_default(), which always returns a
reffed GMainContext, rather than sometimes returning a (non-reffed)
GMainContext, and sometimes returning NULL. This simplifies the
bookkeeping in any code that needs to keep a reference to the
thread-default context for a while.

https://bugzilla.gnome.org/show_bug.cgi?id=660994
2011-10-07 10:14:34 -04:00
Matthias Clasen
97b0b36ae3 USE __COUNTER__ instead of __LINE__ when available
I've seen builds fail with

nm-connection.c:119:691: error: declaration of '_GStaticAssertCompileTimeAssertion_119' shadows a previous local [-Werror=shadow]

because several compile-time assertions ended up on the same
line. __COUNTER__ is meant specifically for the purpose of
constructing identifiers, so use it when available.
2011-10-07 01:19:15 -04:00
Matthias Clasen
c51fa1852d Don't redundantly redeclare
It makes gcc throw an error:

redundant redeclaration of 'g_static_mutex_get_mutex_impl' [-Werror=redundant-decls]
2011-10-07 00:42:52 -04:00
Ryan Lortie
083812f854 Several docs cleanups 2011-10-06 12:19:58 -04:00
Ryan Lortie
94b7d2ee6c Cleanup thread documentation 2011-10-06 12:01:53 -04:00
Chun-wei Fan
ed03047a5b gthread-deprecated.c: Include gutils.h
This is needed for declaration of inline.
2011-10-06 15:12:22 +08:00
Matthias Clasen
3636cf2c64 Update threads docs for the demise of g_thread_init() 2011-10-05 22:43:22 -04:00
Colin Walters
c3133affcd gmacros: Hide G_STATIC_ASSERT from g-ir-scanner
The C syntax here is twisted and confuses the scanner.  We don't
need to see it, so let's just skip it.

https://bugzilla.gnome.org/show_bug.cgi?id=660413
2011-10-05 13:39:30 -04:00
Ryan Lortie
9560423a6e Be sure to #include "gutils.h" in gbacktrace.c
0e3f530185 introduced a compiler warning
about implicit declaration of g_get_prgname().  Fix that.

Problem caught and fix suggested by Rico Tzschichholz.
2011-10-05 13:17:07 -04:00
Dan Winship
7ca83c6c9f Fix up some doc comments that referred to threads not being enabled
(and a few other unrelated comment fixes)
2011-10-05 11:54:36 -04:00
Matthias Clasen
0e3f530185 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
2011-10-05 01:12:53 -04:00
Matthias Clasen
5fef796126 Misc test coverage improvements
https://bugzilla.gnome.org/show_bug.cgi?id=660849
2011-10-05 01:12:52 -04:00
Matthias Clasen
ea4bc6008f Add a test for thread creation failure 2011-10-05 00:28:53 -04:00
Ryan Lortie
08a6d81231 gthread.h: a bunch of pointless whitespace changes
Make it look pretty.
2011-10-04 20:33:58 -04:00
Ryan Lortie
674543d091 Move typedef GStaticPrivate to deprecated/
This was missed in the earlier move.
2011-10-04 20:33:58 -04:00
Ryan Lortie
69c0b4440e 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
2011-10-04 20:08:14 -04:00
Ryan Lortie
4d5fe27048 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
2011-10-04 17:32:53 -04:00
Ryan Lortie
6b566e1d0b 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
2011-10-04 17:32:53 -04:00
Ryan Lortie
e3be556728 end the glib-ctor experiment
This was a bad approach.  We attempt to handle initailisation in a more
centralised way now.
2011-10-04 17:32:53 -04:00
Ryan Lortie
bb5d90a768 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
2011-10-04 17:32:53 -04:00
Ryan Lortie
5bfb64d507 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
2011-10-04 17:32:41 -04:00
Ryan Lortie
f1512917e6 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
2011-10-04 16:08:27 -04:00
Ryan Lortie
dd09a95543 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
2011-10-04 16:02:16 -04:00
Ryan Lortie
2e5cb6f522 win32 fixes from g_thread_init() deprecation
I can't even begin to imagine how these fell through the cracks...
2011-10-04 15:44:48 -04:00
Ryan Lortie
1bf01efb9f gitignore 2011-10-04 15:34:15 -04:00
Ryan Lortie
47444dacc0 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
2011-10-04 15:31:49 -04:00
Ryan Lortie
310c3ed4cc 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
2011-10-04 15:31:49 -04:00
Ryan Lortie
e517fb6cb0 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
2011-10-04 11:52:47 -04:00
Ryan Lortie
518feb45eb 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
2011-10-04 11:13:46 -04:00
Chun-wei Fan
e03db42792 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.
2011-10-04 23:08:12 +08:00
Ryan Lortie
794c1a30bc 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
2011-10-04 11:00:31 -04:00
Ryan Lortie
037c91f845 rec-mutex testcase: add a performance test
Add a reasonable performance test for uncontended and contended cases at
different levels of recursion depth.
2011-10-04 09:45:36 -04:00
Simon McVittie
7973d9f8ba 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>
2011-10-04 12:39:24 +01:00
Simon McVittie
ebb544f549 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>
2011-10-04 12:39:22 +01:00
Simon McVittie
3869e40ac3 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>
2011-10-04 12:39:15 +01:00
Simon McVittie
3d7264ce70 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>
2011-10-04 12:39:08 +01:00
Simon McVittie
83afcc0a29 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>
2011-10-04 12:38:32 +01:00
Simon McVittie
d34c9bc6f3 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>
2011-10-04 12:38:30 +01:00
Simon McVittie
9e827ab615 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>
2011-10-04 12:38:20 +01:00
Simon McVittie
f778564ba2 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>
2011-10-04 09:48:35 +01:00
Simon McVittie
34a1224549 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>
2011-10-04 09:44:27 +01:00
Simon McVittie
06c96ab1e5 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>
2011-10-04 09:42:28 +01:00
Chun-wei Fan
29a71915d8 Update glibconfig.h.win32(.in)
Update typedef of GStaticMutex here to match the typedef of GMutex
in glib/gthread.h (due to commit c5634df6)
2011-10-04 14:06:10 +08:00
Matthias Clasen
ca6a985039 Improve test coverage in the thread tests
Use g_thread_new_full() in some places.
2011-10-04 00:46:10 -04:00
Matthias Clasen
e6fa27a5f8 Improve test coverage in the GString tests 2011-10-04 00:45:42 -04:00
Matthias Clasen
fc32480658 Improve testcoverage in the rec-mutex test
Test g_rec_mutex_trylock() in both locked and unlocked cases.
2011-10-04 00:44:58 -04:00
Matthias Clasen
823e32655e Add a few more tests
This brings test coverage for glist.c and glist.c to the
coveted 100% lines mark.
2011-10-03 23:55:02 -04:00
Matthias Clasen
1fe4429318 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.
2011-10-03 23:54:08 -04:00
Matthias Clasen
b74f46db6b Add some more thread tests 2011-10-03 22:25:47 -04:00
Ryan Lortie
070aefcf59 GAsyncQueue: properly set free function
The copying of code from g_async_queue_new() to g_async_queue_new_full()
in ef08aa786b 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
2011-10-03 22:18:01 -04:00
Matthias Clasen
9d989c7b8a Cosmetics 2011-10-02 23:53:56 -04:00
Matthias Clasen
fa6710ab6f Documentation fixes 2011-10-02 23:43:45 -04:00
Matthias Clasen
65b84bb7d0 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.
2011-10-02 23:43:45 -04:00
Ryan Lortie
65056180dd locks: Add initialisation notes
For each of the 4, mention that static storage or _init() is needed.
2011-10-02 23:37:20 -04:00
Ryan Lortie
c5634df6d3 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.
2011-10-02 22:33:11 -04:00
Ryan Lortie
2a677d1370 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
2011-10-02 22:33:10 -04:00
Ryan Lortie
3315aee709 Re-enable 'include' testcase
The bug is fixed now.

https://bugzilla.gnome.org/show_bug.cgi?id=659866
2011-10-02 22:33:10 -04:00
Ryan Lortie
e081eadda5 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
2011-10-02 22:33:10 -04:00
Matthias Clasen
3d4846d923 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
2011-10-02 22:11:59 -04:00
Matthias Clasen
12287c8cc7 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
2011-10-02 22:11:58 -04:00
Matthias Clasen
1909d2398a 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
2011-10-02 22:11:58 -04:00
Matthias Clasen
0d1a92ca3d 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
2011-10-02 22:11:58 -04:00
Matthias Clasen
34ce4dd032 Replace static privates by privates
GStaticPrivate is heading for deprecation soon, and GPrivate
can replace these uses now.
2011-10-02 22:11:33 -04:00
Ryan Lortie
6f71151823 win32: fix GPrivate fallout
Fix minor mistake in win32 GPrivate code.
2011-10-02 21:31:45 -04:00
Ryan Lortie
cdd43d43c9 locks: rename a bunch of parameters 2011-10-02 20:24:18 -04:00
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
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
Matthias Clasen
b4dc4902c6 Mark g_thread_create_with_stack_size as new API 2011-10-01 13:47:09 -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
Matthias Clasen
cde8cf16fa Some more gthread reshuffling 2011-09-29 20:23:19 -04:00
Dan Winship
f992c240e8 gthread: remove a stray reference to GStaticMutex 2011-09-29 09:59:15 -04:00
Dan Winship
0f4b278a4b update .gitignores 2011-09-28 12:20:09 -04: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
6bd959b727 glib tests: Compile new thread tests on win32
They accidentally got added inside of a 'if OS_UNIX'.  Move them out.
2011-09-26 09:05:53 -04:00
Ryan Lortie
fdc594e963 winxp threads: detect SRWLock emulation reentrancy
We lack SRWLock on Windows XP, so we use CRITICAL_SECTION to emulate it
there.  SRWLock is non-recursive, but CRITICAL_SECTION will happily
allow itself to be acquired multiple times by the same thread.

We need to detect if our second acquire succeeded because of the
recursive nature of CRITICAL_SECTION.  In the case of a _lock()
operation, we would normally have deadlocked, so abort.  In the case of
a _trylock() operation, we need to ensure that FALSE is properly
returned.

Problem caught by Matthias Clasen and Chun-wei Fan.

https://bugzilla.gnome.org/show_bug.cgi?id=660096
2011-09-26 08:54:51 -04:00
Stef Walter
5a95e19a46 gvariant: Add g_variant_get_fixed_array()
Using g_variant_new_from_data() for creating new byte arrays is non-obvious.
This patch adds a g_variant_new_fixed_array() function.

https://bugzilla.gnome.org/show_bug.cgi?id=659923
2011-09-25 07:57:26 +02:00
Matthias Clasen
81e395b00b More GThread docs tweaks 2011-09-25 01:32:41 -04:00
Matthias Clasen
900c467fd0 Move GThread docs around 2011-09-25 01:01:00 -04:00
Matthias Clasen
db04f59780 Move includes to the top of the file 2011-09-25 01:01:00 -04:00
Matthias Clasen
0ea89987e2 Move deprecated GThread functions to a separate file 2011-09-25 01:01:00 -04:00
Matthias Clasen
e34861da08 GThread: more doc updates 2011-09-25 01:01:00 -04:00
Matthias Clasen
4e44e23517 Drop G_THREADS_IMPL_NONE from the docs
GLib can no longer be built without thread support.
2011-09-25 01:00:59 -04:00
Chun-wei Fan
8f340e2d75 Fix warning/error C4013 (implicit declarations)
-Include gthread.h in gregex.c as g_once_init_enter and g_once_init_leave
 are used.
-Define prototype for g_thread_DllMain in gthreadprivate.h for Windows
2011-09-25 09:07:59 +08:00
Chun-wei Fan
2b391940c0 gthread.c: Declare variable at start of block
This is so that C89 compilers will not complain.
2011-09-25 09:07:37 +08:00
Matthias Clasen
a485a0e565 Document G_THREADS_IMPL_WIN32 2011-09-24 19:04:46 -04:00
Matthias Clasen
d6b0af99d7 GThread doc additions 2011-09-24 19:01:02 -04:00
Matthias Clasen
df9e5c2435 Fix an uninialized variable warning 2011-09-24 19:01:02 -04:00
Matthias Clasen
cf9623767a Add a testcase for bug 659866
Mere inclusion of glib headers should not require you to define
any XYZ_SOURCE macros.
2011-09-24 00:39:59 -04:00
Matthias Clasen
e1f68c1292 Add a test for GCond 2011-09-23 23:38:26 -04:00
Matthias Clasen
a118313599 Add a nontrivial read-write lock test 2011-09-23 22:07:32 -04:00
Matthias Clasen
158a0366be Add GOnce tests 2011-09-23 21:19:53 -04:00
Matthias Clasen
dd002113f1 Make the rec mutex test a little more verbose 2011-09-23 21:11:10 -04:00
Matthias Clasen
cf020d8250 Add a non-trivial GRWLock test
This one tests that the writer lock behaves like a mutex.
Adapted from the corresponding test in GMutex.
2011-09-23 07:25:07 -04:00
Matthias Clasen
0a9885ebd8 Add a non-trivial GRecMutex test
Adapted from the corresponding GMutex test.
2011-09-23 07:25:07 -04:00
Matthias Clasen
de39df9dc1 Remove an unused variable 2011-09-23 07:25:06 -04:00
Matthias Clasen
798a7d5abe Add some more rw lock tests
These test some simple mixed reader/writer api usage.
2011-09-23 06:31:59 -04:00
Matthias Clasen
81b3708184 Add a mutex test
This tests that mutexes do what they are supposed to do.
Copied from a similar test for bitlocks in gthread/tests/bitlock.c.
2011-09-23 06:31:59 -04:00
Matthias Clasen
4f3026ea23 Add headers 2011-09-22 22:45:47 -04:00
Matthias Clasen
d4d203e3cb Fix g_rwlock_{writer,reader}_trylock 2011-09-22 22:45:47 -04:00
Matthias Clasen
ff13913537 Add basic tests for GRWLock
Just basic api usage, no functional test cases yet.
2011-09-22 22:45:47 -04:00
Chun-wei Fan
b2717740a2 VS support updates
-Fix GLib project/filter files generation as some source items are under
 the "deprecated" subfolder, and filter out the gthread-*.c
-Explicitly specify gthread-win32.c in the GLib project/filter file
 templates, since tarballs are done on Linux.
-Don't define g_static_mutex_get_mutex in the pregenerated
 glibconfig.h.win32(.in) as it is defined in deprecated/gthread.h for Windows
2011-09-23 10:48:25 +08:00
Matthias Clasen
9de564bf1f Fix g_rec_mutex_trylock 2011-09-22 21:58:55 -04:00
Matthias Clasen
295af777e4 Add trivial tests for GMutex and GRecMutex
Not testing any mutual exclusion with threads yet, just
basic api use. This is already enough to reveal g_rec_mutex_trylock
as broken...
2011-09-22 21:58:54 -04:00
Chun-wei Fan
9958909fb2 gmappedfile.c: Define S_IFREG on Win32 when it's not available
Make a workaround for S_IFREG in gmappedfile.c on Windows as it may not be
available for a given compiler on that platform
2011-09-23 09:36:37 +08:00
Ryan Lortie
c59846086b Add gthread.h to deprecated headers
...not deprecated sources
2011-09-22 13:48:00 -04:00
Matthias Clasen
558955dd85 Some gthread doc updates
Marking things as deprecated, mostly.
2011-09-22 01:16:41 -04:00
Matthias Clasen
cedc82290f Use adaptive mutexes when available
These are supposedly better on multi-cpu systems - and who doesn't
have multiple cpus nowadays. One single-processor systems, they
are identical to normal mutexes.
See e.g. http://bugzilla.mozilla.org/show_bug.cgi?id=132089

https://bugzilla.gnome.org/show_bug.cgi?id=659423
2011-09-22 00:54:34 -04:00
Ryan Lortie
19e7026fe7 GDateTime test: fix a race
We have a GDateTime test that compares the time now (as per the libc) to
the time now (as per GDateTime).  The problem is that the time could
change between those two "now"s.
2011-09-21 20:23:03 -04:00
Ryan Lortie
af9e40dc5d gslice: remove single-threaded case
GPrivate always works, so use it normally at all times.
2011-09-21 20:23:02 -04:00
Philip Van Hoof
ca154c399b GMappedFile: Add API to create from an existing file descriptor
At Tracker we want to mmap files using O_NOATIME. With GMappedFile this is at
the moment impossible. For that reason I added the constructor new_from_fd to
the GMappedFile type.

https://bugzilla.gnome.org/show_bug.cgi?id=659754
2011-09-22 00:01:56 +02:00
Ryan Lortie
24652730a9 Deprecate GStatic{,Rec,RW}Mutex
The new versions use the primatives of the OS directly and don't have an
annoying ABI.
2011-09-21 16:09:05 -04:00
Ryan Lortie
b6140c2f89 Port internal GStaticRecMutex users to GRecMutex 2011-09-21 16:09:04 -04:00
Ryan Lortie
ad187e3a9b Add a new recursive mutex type, GRecMutex
This is implemented using the native facilities of each platform instead
of manually.
2011-09-21 16:09:04 -04:00
Ryan Lortie
3d4102776e Add GRWLock 2011-09-21 16:09:03 -04:00
Ryan Lortie
42af8eb39d gthread: remove impl init functions 2011-09-21 16:06:56 -04:00
Ryan Lortie
2539bd007d win32: Add 'shared' support to SRWLock emulation 2011-09-21 16:06:56 -04:00
Ryan Lortie
9f42e3be1b gthread-win32: trivial condition change
Make another do-nothing change to the SRWLock emulation.
2011-09-21 16:06:56 -04:00
Ryan Lortie
391aea32f3 gthread-win32: rename a struct member
Our SRWLock is about to become a real reader/writer lock, so rename an
instance variable to prepare for that.
2011-09-21 16:06:56 -04:00
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