Commit Graph

299 Commits

Author SHA1 Message Date
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
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
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
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
Matthias Clasen
daede1dc27 Disable deprecations where appropriate in tests 2011-10-12 00:48:18 -04:00
Matthias Clasen
749758ec78 Add a warning to g_thread_init_with_errorcheck_mutexes
Should anybody try to use this, we should at least tell them that
its gone.
2011-10-05 22:23:25 -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
Matthias Clasen
bc67c23bf9 Define GLIB_COMPILATION when building libgthread.so
This is necessary, because gthreadprivate.h can only be
included inside GLib, otherwise single-include guards trigger.
2011-10-02 22:11:34 -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
c33cd00739 Stop using GStaticMutex in two testcases 2011-09-21 16:06:53 -04:00
Ryan Lortie
413186a962 emufutex: remove init from g_thread_init_glib
Use a GStaticMutex instead.
2011-09-09 13:23:48 -04:00
Ryan Lortie
cfa1d0540e Move the GThread implementations to glib/
We can now get threads initialised from inside of libglib by calling
g_thread_init_glib().
2011-09-09 12:47:40 -04:00
Ryan Lortie
96e4896804 invert gthread-impl includes
configure.ac defined G_THREAD_SOURCE and gthread-impl would #include it.

Instead, since we only have two thread implementations now, and since we
always use the Windows one only on Windows, move the logic to the
Makefile, predicated on 'if OS_WIN32'.  Then have the chosen backend do
the #include "gthread-impl.c" from there.

Remove the G_THREAD_SOURCE define from configure.ac.
2011-09-09 12:47:40 -04:00
Ryan Lortie
fc6a9275a4 win32 threads: assume TryEnterCriticalSection
Remove the dynamic lookup for TryEnterCriticalSection, which has existed
since Windows 2000.
2011-09-09 12:47:40 -04:00
Ryan Lortie
7cf89847e2 Stop using HAVE_G_THREAD_IMPL_INIT
Just always call the init function.
2011-09-09 12:47:40 -04:00
Ryan Lortie
46af418e05 Move thread priority translation into the backends
The translation of GLib priorities into the thread priorities of
different operating systems belongs in the implementation -- not
half-way in the front end.
2011-09-09 12:47:40 -04:00
Ryan Lortie
a4777122c8 Remove useless macros from when we supported DCE
These are non-ops now, and easily replaced.
2011-09-09 12:47:40 -04:00
Ryan Lortie
715f94e951 Remove support for DCE threads 2011-09-09 12:47:40 -04:00
Ryan Lortie
7d885253fa Remove support for custom thread implementations 2011-09-09 12:47:39 -04:00
Ryan Lortie
cef0acb945 Remove the dead 'none' thread implementation 2011-09-09 12:47:39 -04:00
Ryan Lortie
3f93141243 GThread: remove errorcheck mutex support
This can only possibly work if we call g_thread_init(), which we are
moving away from.
2011-09-09 12:47:39 -04:00
Ryan Lortie
41cbb40dca gthread: remove some unused forward declarations 2011-09-09 12:47:39 -04:00
Ryan Lortie
e48573c402 Deprecated (undocumented) g_thread_gettime
g_thread_gettime() is an undocumented public function pointer that
points to a function that returns the monotonic time in nanoseconds.
g_get_monotonic_time() does the same in microseconds, so it can be used
instead.

GLib had one internal user in GFileMonitor that only cared about
millisecond accuracy; it has been ported to g_get_monotonic_time().
2011-09-09 12:47:39 -04:00
Dan Winship
5bc7729d16 Make threads mandatory
G_THREADS_ENABLED still exists, but is always defined. It is still
possible to use libglib without threads, but gobject (and everything
above it) is now guaranteed to be using threads (as, in fact, it was
before, since it was accidentally impossible to compile with
--disable-threads).

https://bugzilla.gnome.org/show_bug.cgi?id=616754
2011-09-09 12:41:55 -04:00
Ryan Lortie
d87eddbb13 .gitignore the gwakeup-fallback testcase 2011-07-25 18:52:36 +02:00
Ryan Lortie
c81eb121a1 GWakeup: make it private API
Colin requests that we keep this one private for now.

Include it at each point of use (libglib, libgio, tests).
2011-07-25 18:51:03 +02:00
Ryan Lortie
0584f0c504 GWakeup: test fallback case
We need to test the case of eventfd in the libc but no kernel support.

In order to do that, we add a separate compile of the GWakeup testcase
that interposes an 'eventfd' symbol that always returns -1 with errno
set.  That will trigger the fallback case.
2011-07-25 17:43:28 +02:00
Ryan Lortie
3c25f9f609 GWakeup .gitignore fixes 2011-07-25 15:30:36 +02:00
Ryan Lortie
4026b33174 add a couple of testcases for GWakeup 2011-07-25 15:30:35 +02:00
Ryan Lortie
804e3ba4dd gitignore tweaks 2011-07-22 15:47:24 +02:00
Matthias Clasen
6dfd21caef Run some tests with errorcheck mutexes too
All in the name of better test coverage.
2011-06-23 00:05:18 -04:00
Colin Walters
4344838781 gthread tests: Remove spurious return; 2011-06-20 14:09:50 -04:00
Colin Walters
c2364ce9a4 spawn-multithreaded: Clean up IO channel code
I modeled the new bits after how gunixmount.c handles GIOChannel;
it's apparently easier not to look at the condition.

https://bugzilla.gnome.org/show_bug.cgi?id=652072
2011-06-14 19:23:36 -04:00
Colin Walters
922f6aa496 spawn-singlethread.c: New test
https://bugzilla.gnome.org/show_bug.cgi?id=652072
2011-06-14 19:23:35 -04:00
Colin Walters
01ee9449e3 spawn-multithreaded: Also look for lt-test-echo
I hate libtool =(

https://bugzilla.gnome.org/show_bug.cgi?id=652072
2011-06-14 19:23:35 -04:00
Dan Winship
7412e073d1 update .gitignores 2011-06-12 16:17:30 -04:00
Chun-wei Fan
405b4ff4f4 Update the year in the *.rc.in files
Sorry this change came a bit late...
2011-06-07 08:55:31 +08:00
Ryan Lortie
df0b208831 Implement pointer sized bitlocks
Based on a patch from Alexander Larsson.

https://bugzilla.gnome.org/show_bug.cgi?id=651467
2011-06-03 20:50:18 -04:00
Colin Walters
d51198baad spawn-multithreaded: New test case
We didn't have any coverage of threads spawning processes, which we
should definitely support.

https://bugzilla.gnome.org/show_bug.cgi?id=651725
2011-06-03 11:43:26 -04:00
Simon McVittie
22cc6ce679 Add a regression test for GNOME#642026
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=642026
Bug-NB: NB#257512
2011-05-28 10:00:42 -04:00
Marc-André Lureau
30672af7ff gthread: build unix tests only on unix
The build fails when compiling with mingw32. Correct the build of a
unix tests on unix only.

https://bugzilla.gnome.org/show_bug.cgi?id=649973
2011-05-26 11:19:20 +02:00
Matthias Clasen
9255350a70 Add some atomic ops tests 2011-05-22 01:29:22 -04:00
Dan Winship
181763438a Update .gitignores 2011-05-02 09:54:15 -04:00
Colin Walters
549d895fa4 glib-unix: New API to watch some Unix signals
This new API allows watching a few select Unix signals;
looking through the list on my system, I didn't see anything
else that I think it'd reasonable to watch.

We build on the previous patch to make the child watch helper thread
that existed on Unix handle these signals in the threaded case.
In the non-threaded case, they're just global variables.

https://bugzilla.gnome.org/show_bug.cgi?id=644941
2011-04-27 16:01:39 -04:00
Matthias Clasen
1bbf4cb87c Remove the dead --disable-visiblity configure option
At the same time, document --disable-Bsymbolic.
2010-12-15 11:41:05 -05:00
Ryan Lortie
b3b7ea8e22 Replace -I with $(glib_INCLUDES) and friends
Stop using ad hoc -I in all of our Makefile.am.  Use the new variables
instead.
2010-08-06 13:10:34 -04:00
paul
9f6faaffb6 Add $(top_builddir)/glib to includes
This is required to find glibconfig.h during srcdir != builddir builds
2010-08-05 09:08:34 -04:00