1. 08 Jan, 2007 1 commit
    • Matthias Clasen's avatar
      Don't link glib against libpthread. (#393812) · 541462ab
      Matthias Clasen authored
      2007-01-07  Matthias Clasen  <mclasen@redhat.com>
      
      	Don't link glib against libpthread.  (#393812)
      	
      	* configure.in: Link gthread against librt, not glib itself.
      
      	* glib/gthread.h:
      	* glib/gthread.c: Add a new thread function, gettime.
      
      	* glib/gtimer.c: Use gettime instead of directly working with
      	the various system interfaces.
      
      	* gthread/gthread-impl.c:
      	* gthread/gthread-posix.c:
      	* gthread/gthread-win32.c: Implement gettime.
      	
      
      svn path=/trunk/; revision=5227
      541462ab
  2. 11 May, 2006 1 commit
  3. 09 May, 2006 1 commit
  4. 09 Jun, 2005 1 commit
  5. 01 Nov, 2004 1 commit
  6. 04 Nov, 2002 1 commit
    • Owen Taylor's avatar
      Include config.h so DISABLE_MEMPOOLS actually has an effect. (#96437, · d4407e38
      Owen Taylor authored
      Mon Nov  4 14:41:48 2002  Owen Taylor  <otaylor@redhat.com>
      
              * glib/gbsearcharray.c: Include config.h
              so DISABLE_MEMPOOLS actually has an effect.
              (#96437, Morten Welinder)
      
              * tests/uri-test.c: Include <config.h>
      
      Mon Nov  4 14:42:36 2002  Owen Taylor  <otaylor@redhat.com>
      
              * gtype.c gsignal.c gvaluearray.c: Include config.h
              so DISABLE_MEMPOOLS actually has an effect.
              (#96437, Morten Welinder)
      
              * gsignal.c: Conditionalize definition of g_handler_ts
              on DISABLE_MEM_POOLS (#96437)
      
      Mon Nov  4 14:45:24 2002  Owen Taylor  <otaylor@redhat.com>
      
              * gthread-posix.c gthread-solaris.c: Include <config.h>
      d4407e38
  7. 06 Aug, 2002 1 commit
    • Sebastian Wilhelmi's avatar
      Set the normal PID surrogate priority according to getpid() to avoid · 3faf9591
      Sebastian Wilhelmi authored
      
      2002-08-06  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
      
      	* glib/gthread.c: Set the normal PID surrogate priority according
      	to getpid() to avoid errors for niced processes. (#86116)
      
      	* gthread/gthread-impl.c, gthread/gthread-posix.c,
      	gthread/gthread-solaris.c: Do the same for the posix/dce
      	implementation. Solaris still needs to set priority of the main
      	thread, because all unbound threads will schedule according to
      	that value and it defaults to 0 (the minimal value).
      3faf9591
  8. 10 Mar, 2002 1 commit
  9. 19 Sep, 2001 1 commit
    • Sebastian Wilhelmi's avatar
      Add thread_equal function to allow for platform defined function to · f8f4c377
      Sebastian Wilhelmi authored
      2001-09-19  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
      
      	* glib/gthread.h (GThreadFunctions): Add thread_equal function to
      	allow for platform defined function to compare two threads.
      
      	* glib/gthread.c: Use g_thread_functions_for_glib_use.thread_equal
      	when non-NULL instead of ==.
      
      	* gthread/gthread-posix.c: Add g_thread_equal_posix_impl and
      	add to the function vector g_thread_functions_for_glib_use_default.
      
      	* gthread/gthread-solaris.c, gthread/gthread-win32.c: Add NULL
      	as equal function, as on those two platforms you don't need an
      	equal function.
      f8f4c377
  10. 08 May, 2001 1 commit
  11. 03 Apr, 2001 1 commit
  12. 15 Feb, 2001 1 commit
    • Sebastian Wilhelmi's avatar
      Reverted the changes necessary to enlarge the system thread for · efb2e89e
      Sebastian Wilhelmi authored
      
      2001-02-15  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
      
      	* acconfig.h, configure.in: Reverted the changes necessary to
      	enlarge the system thread for G_THREAD_USE_PID_SURROGATE.
      
      	* gthread.c: Now implement G_THREAD_USE_PID_SURROGATE in gthread.c
      	instead of gthread/gthread-posix.c. While the latter has the
      	advantage, that it is conceptually cleaner, it makes
      	g_thread_self_posix_impl _very_ slow and that hurts
      	GStaticRecMutex and other things. So the new version is less
      	clean, but faster.
      
      	* gthread-posix.c: Removed the G_THREAD_USE_PID_SURROGATE
      	implementation, which is now in gthread.c.
      efb2e89e
  13. 03 Jan, 2001 1 commit
    • Sebastian Wilhelmi's avatar
      Made g_thread_min_stack_size static. · b1d840c2
      Sebastian Wilhelmi authored
      
      2001-01-03  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
      
              * gthread-solaris.c, gthread-posix.c: Made g_thread_min_stack_size
              static.
      
      2CVS: ----------------------------------------------------------------------
      b1d840c2
  14. 21 Nov, 2000 1 commit
    • Sebastian Wilhelmi's avatar
      Add a surrogate for thread priorities using PID niceness for systems with · a3036a5b
      Sebastian Wilhelmi authored
      
      2000-11-21  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
      
      	* configure.in: Add a surrogate for thread priorities using PID
      	niceness for systems with no thread priorities and different PIDs
      	for threads of the same process (most notably: Linux). Define
      	G_THREAD_USE_PID_SURROGATE in that case, as used by
      	gthread-posix.c. Also make the system thread bigger by
      	sizeof (long) to contain the thread's PID.
      
      	* gfileutils.c: Include stdlib.h for mkstemp prototype.
      
      	* gthread.c: Add priority range checks to the affected functions.
      
      	* gthreadpool.c: Remove unused variable.
      
      	* gthread-impl.c, gthread-posix.c, gthread-solaris.c: Removed
      	g_thread_map_priority function in favour of the
      	g_thread_priority_map array.  Initialize the array with
      	PRIORITY_{...}_VALUE, if available and interpolate beetween the
      	bounds if .._NORMAL_.. and .._HIGH_.. are not available.
      
      	* gthread-posix.c: If we should use the PID niceness as a
      	surrogate for thread priorities (G_THREAD_USE_PID_SURROGATE is
      	defined), then disable normal priority handling and use PIDs and
      	setpriority() instead. Depends on the thread to write its PID into
      	the place after the thread id right after thread creation.
      a3036a5b
  15. 15 Nov, 2000 1 commit
    • Sebastian Wilhelmi's avatar
      Check for the sched.h header and include it on gthread/gthread-posix.c if · b9731eb8
      Sebastian Wilhelmi authored
      
      2000-11-15  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
      
      	* configure.in: Check for the sched.h header and include it on
      	gthread/gthread-posix.c if available.
      
      	* gthread-posix.c: Include <sched.h> if available.
      
      	* configure.in: Add -D_POSIX4_DRAFT_SOURCE to
      	GTHREAD_COMPILE_IMPL_DEFINES. Also add -D_POSIX4A_DRAFT10_SOURCE
      	to G_THREAD_CFLAGS. Really deploy GTHREAD_COMPILE_IMPL_DEFINES,
      	when searching for thread libs. Look for sched_* functions in
      	-lrte as well. All of that is necessary on DG/UX.
      
      	* configure.in: Use AC_TRY_COMPILE instead of AC_EGREP_HEADERS in
      	various places to make it work more reliable, to make it accept
      	macros instead of functions etc.
      
      	* configure.in: Replace some NULL's for checks with 0 to make it
      	work without stdio.h everywhere.
      
      	* configure.in, gutils.c: changed the test for getpwuid_r to first
      	test for a posix version and then for a non-posix version. No code
      	change in gutils.c. Again this change deals better with getpwuid_r
      	being a macro and not a function. Most of the above with kind help
      	from Tethys <tet@isengard.europe.dg.com>. This fixes Bug #13403.
      b9731eb8
  16. 25 Oct, 2000 1 commit
    • Sebastian Wilhelmi's avatar
      Add @GLIB_DEBUG_FLAGS@ to INCLUDES for accessing -DG_ENABLE_DEBUG as · b13320f7
      Sebastian Wilhelmi authored
      
      2000-10-25  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
      
      	* Makefile.am : Add @GLIB_DEBUG_FLAGS@ to INCLUDES for accessing
      	-DG_ENABLE_DEBUG as needed in gthread-posix.c.
      
      	* gthread-posix.c: Revamped error handling for native thread
      	function calls. Now EPERM errors are ignored for some commands and
      	only a warning message is output once (at first occurrence).
      b13320f7
  17. 29 Sep, 2000 1 commit
    • Sebastian Wilhelmi's avatar
      Added errorcheck mutexes. These are activated through the preprocessor · 7633908c
      Sebastian Wilhelmi authored
      2000-09-29  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
      
      	* configure.in, glib.h: Added errorcheck mutexes. These are
      	activated through the preprocessor symbol
      	G_ERRORCHECK_MUTEXES. Need to add an extra word to StaticMutex in
      	order to achieve this. g_(static_)mutex_* functions instrument the
      	mutex operations with mutex name and location, when compiled with
      	-DG_ERRORCHECK_MUTEXES. g_thread_init activates the errorcheck
      	mutexes, when compiled with -DG_ERRORCHECK_MUTEXES.
      
      	* gthread/gthread-impl.c: Added errorcheck mutexes. New
              exported function
              g_thread_init_with_errorcheck_mutexes, which is called instead of
      	g_thread_init, when compiled with -DG_ERRORCHECK_MUTEXES. New
      	static functions
      	g_mutex_(new|lock|trylock|unlock|free)_errorcheck_impl to
      	implement errorcheck mutexes.
      
      	* gthread/gthread-posix.impl.c, gthread/gthread-solaris-impl.c:
              Define the size of a mutex.
      7633908c
  18. 06 Sep, 2000 1 commit
    • Sebastian Wilhelmi's avatar
      s/G_MICROSEC/G_USEC_PER_SEC/ · ef2dcd62
      Sebastian Wilhelmi authored
      
      2000-09-06  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
      
      	* glib.h, gtimer.c, tests/thread-test.c:
      	s/G_MICROSEC/G_USEC_PER_SEC/
      
      	* gthread/gthread-posix.c, gthread/gthread-solaris.c:
      	s/G_MICROSEC/G_USEC_PER_SEC/ and s/G_NANOSEC/G_NSEC_PER_SEC/
      ef2dcd62
  19. 01 Sep, 2000 2 commits
    • Sebastian Wilhelmi's avatar
      Use GError to report errors as well. · 4d1cb41e
      Sebastian Wilhelmi authored
      
      2000-09-01  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
      
      	* gthread-solaris.c (g_thread_create_solaris_impl): Use GError to
      	report errors as well.
      4d1cb41e
    • Sebastian Wilhelmi's avatar
      Include gerror.h before it is used for some g_thread_* functions. · 64bbfbb6
      Sebastian Wilhelmi authored
      
      2000-09-01  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
      
      	* glib.h: Include gerror.h before it is used for some g_thread_*
      	functions.
      
      	* gthread.c, gthreadpool.c, glib.h: Enable error reporting for
      	thread creation, namly for g_thread_create, g_thread_pool_new,
      	g_thread_pool_push and g_thread_pool_set_max_threads.
      
      	* tests/thread-test.c, tests/threadpool-test.c: Adapted
      	accordingly.
      
      	* gthread-posix.c (g_thread_create_posix_impl): Use GError to
      	report errors.
      64bbfbb6
  20. 26 Jul, 2000 1 commit
  21. 20 Mar, 2000 1 commit
  22. 17 Mar, 2000 1 commit
    • Sebastian Wilhelmi's avatar
      Added the missing POSIX_NO_YIELD and POSIX_NO_PRIORITIES warning messages. · 5e713437
      Sebastian Wilhelmi authored
      2000-03-17  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
      
      	* configure.in: Added the missing POSIX_NO_YIELD and
      	POSIX_NO_PRIORITIES warning messages.
      
      	* configure.in: Use AC_TRY_RUN instead of AC_TRY_LINK, to test for
      	real thread support. On solaris pthread_create can be linked to
      	even in -lc, but it doesn't work then.
      
      	* configure.in: Don't use priorities for threads, when the
      	minimal/maximal priorities couldn't be determined at configure
      	time.
      
      	* configure.in, gthread.c: Always define GSystemThread in
      	glibconfig.h to represent a system thread.
      
      	* configure.in: Do not use native recursive threads, when
      	possibe. We use some features, that they do not expose (namely the
      	depth counter).
      
      	* glib.h, gthread.c: Redefined GStaticRecMutex. The functions are
      	now implemented in a different way, which should be way
      	faster. Alsothere are now functions g_static_rec_mutex_unlock_full
      	and g_static_rec_mutex_lock_full to leave/enter a recursive mutex
      	completly.
      
      	* gthread.c (g_thread_self): Do not test the system_thread to be
      	non-zero to speed things up.
      
      	* gthread.c (g_mutex_init): Therefore set the system_thread of the
      	main thread here.
      
      	* tests/thread-test.c: Rerun all tests once again, but this time
      	we fool the system into thinking, that the available thread system
      	is not native, but userprovided.
      
      	* gthread/gthread-posix.c: Don't use priorities for threads,
      	when the minimal/maximal priorities couldn't be determined at
      	configure time.
      
      	* gthread/gthread-posix.c: Don't check for errors, when
      	setting the scope of a tread to system, as some posix
      	implementations can't do that and we don't want the thing to
      	fail because of that.
      5e713437
  23. 22 Feb, 2000 1 commit
  24. 16 Nov, 1999 1 commit
    • Sebastian Wilhelmi's avatar
      Changed the prototype of thread_create and thread_self to return the · f0f028ab
      Sebastian Wilhelmi authored
      1999-11-16  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
      
              * gthread-posix.c, gthread-solaris.c: Changed the prototype of
              thread_create and thread_self to return the system thread into
              provided memory instead of a return value. This is necessary, as
              HPUX has a pthread_t, that is bigger than the biggest integral
              type there. Made some more functions static.
      
              * gthread-posix.c: Small fixes for DCE threads: Detaching has to
              be done after thread creation for DCE.
      f0f028ab
  25. 20 Jun, 1999 1 commit
    • Tor Lillqvist's avatar
      Update the pthreads snapshot version we want. Advice how to hand-expand · be80f9a1
      Tor Lillqvist authored
      	* README.win32: Update the pthreads snapshot version we want.
      	Advice how to hand-expand the makefile.*.in files.
      
      	* config.h.win32.in: Define values needed by Sebastian Wilhelmi's
      	new thread stuff.
      
      	* glib.def: Add new functions.
      
      	* glibconfig.h.win32.in: Update the pthreads snapshot version.
      	Fix typo.
      
      	* gthread.c: Include config.h, guard inclusion of unistd.h.  When
       	using gcc on Win32, g_thread_functions_for_glib_use must be marked
       	for export here, too.
      
      	* gtimer.c: Implement g_usleep on native Win32 using Sleep (which
      	only has millisecond granularity, though).
      
      	* makefile.cygwin.in
      	* makefile.msc.in: Update pthreads snapshot version. File
      	name changes. Remove testgthread.
      
      	* tests/makefile.cygwin.in
      	* tests/makefile.msc.in: Add thread-test. Link with gthread lib.
      
      	* gthread-posix.c: Guard pthread_attr_setscope call with test
      	for _POSIX_THREAD_PRIORITY_SCHEDULING, which should be defined
      	in a <pthread.h> that supports that feature.
      be80f9a1
  26. 17 Jun, 1999 1 commit
    • Sebastian Wilhelmi's avatar
      Completed the thread support in GLib. Thread creation, prioritizing · 90f6cc9b
      Sebastian Wilhelmi authored
      
      1999-06-17  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
      
      	* configure.in, acglib.m4, acconfig.h, glib.h, gthread.c:
      	Completed the thread support in GLib. Thread creation,
      	prioritizing threads, yielding, joining threads as well as
      	reader/writer locks and recursive mutexes are now in place. Please
      	test heavily on your platform. It is so far tested on
      	Linux/i386/pthreads, Solaris/Sparc/pthreads and
      	Solaris/Sparc/solaristhreads.
      
      	* gtimer.c, glib.h: Implement g_usleep (gulong microseconds) for
      	thread safe sleeping. (sleep() is not MT-safe at all!)
      
      	* gutils.c: Avoid compiler warning.
      
      	* tests/Makefile.am, tests/thread-test.c: New program to test some
      	aspects of the thread implementation.
      
      	* gthread.c, Makefile.am: Renamed from gmutex.c to reflect the
      	change of content.
      
      	* configure.in: Purged all appearances of nspr.
      
      	* gthread/gthread-posix.c, gthread-solaris.c: Added the native
      	implementations for the GLib's extended thread support.
      
      	* gthread/gthread-nspr.c: Removed for good. NSPR is nothing we
      	would want to build upon.
      
      	* gthread/gthread.c: Renamed to gthread-impl.c to avoid
      	confusion with ../gthread.c (Formerly known as the file called
      	gmutex.c)
      
      	* gthread/testgthread.c: Removed. The new and much extended
              tests are in ../tests/thread-test.c.
      
      	* gthread/Makefile.am: Changed to reflect the changes above.
      90f6cc9b
  27. 31 Mar, 1999 1 commit
  28. 12 Mar, 1999 1 commit
  29. 11 Mar, 1999 1 commit
    • Sebastian Wilhelmi's avatar
      Revamped the thread configure stuff. Now dce threads (old posix draft) are · 4c63008b
      Sebastian Wilhelmi authored
      1999-03-11  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
      
      	* configure.in: Revamped the thread configure stuff. Now dce
      	threads (old posix draft) are recogniced. This is necessary,
      	because dce threads are in fact working quite differently from
      	posix threads. Also changed the conditions for checking for MT
      	safe functions a bit, because G_THREADS_IMPL_NONE still have to
      	compile thread safe.
      
      	* gthread/gthread-posix.c: Now handle both dce and posix
      	threads. They are sufficently equal.
      
      NOTE: Please do not commit my change to
      glib-1-2/{acconfig.h,configure.in,config.h.win32} from 1999-03-03, as
      the current change will take care of that too.
      4c63008b
  30. 24 Feb, 1999 1 commit
  31. 08 Feb, 1999 1 commit
    • Sebastian Wilhelmi's avatar
      Changed the test for getpwuid_r to exclude those systems (i.e. IRIX), that · fa5d3b74
      Sebastian Wilhelmi authored
      1999-02-08  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
      
      	* configure.in, acconfig.h: Changed the test for getpwuid_r to
      	exclude those systems (i.e. IRIX), that set ENOSYS after the call.
      	Test, if pthread_getspecific is posix like or something different,
      	as on PCThreads.
      
      	* gthread/gthread-posix.c (g_private_get_posix_impl): Use the
      	HAVE_PTHREAD_GETSPECIFIC_POSIX macro to determine, which signature
      	to use for pthread_getspecific.
      fa5d3b74
  32. 16 Jan, 1999 1 commit
    • Tor Lillqvist's avatar
      Merge in current Win32 version. Almost no Unix code touched. · f477518c
      Tor Lillqvist authored
      	* README.win32: More text.
      
      	* config.h.win32 glibconfig.h.win32: Update to match the
      	corresponding generated files on Unix.
      
      	* makefile.msc: Update with new source files, and gthread
       	library. Use the compiler flag -MD instead of using -D_DLL and
      	"/nodefaultlib:libc msvcrt.lib" in the link phase.
      
      	* glib.def: Include new functions, drop removed ones.
      
      	* glib.h: Add comments about main loop and polling on Win32. (In
      	general, it's only for the GIMP's use.) Add Win32 IO Channel
      	functions. Remove the obsoleted old IO Channel stuff (which was
      	in #if 0 already).
      
      	* giowin32.c: New file.
      
      	* gmain.c: Include config.h, conditionalize <sys/time.h>
       	inclusion.  Add g_poll implementation for Win32 (only for the
       	GIMP's needs for now, it's hard or even impossible to be as clean
       	and generic as on Unix). Implement g_get_current_time on Win32. If
       	threads aren't supported, don't try to wake up main thread's
       	loop. On Win32, use a semaphore and not a pipe to wake up the main
       	loop.
      
      	* gmessages.c: On Win32, allocate a console window if the standard
      	output handle is invalid before writing to stdout, and reopen stdout
      	to that console window.
      
      	* giochannel.c: Conditionalize unistd.h inclusion. Some indentation
      	cleanup.
      
      	* gstrfuncs.c: Include <signal.h>.
      
      	* gutils.c: On Win32, also check the HOMEDRIVE and HOMEPATH
      	environment variables.
      
      	* gmodule-dl.c gmodule-dld.c: In
       	_g_module_build_path, don't add the "lib" prefix and
       	".so" or ".sl" suffix if already there.
      
      	* gmodule-win32.c: Likewise for the ".dll" suffix.
      
      	* gthread-posix.c: Conditionalize <sys/time.h> inclusion.
      f477518c
  33. 17 Dec, 1998 1 commit
    • CST 1998 Shawn T. Amundson's avatar
      giounix.c: s/g_main_poll_add/g_main_remove_add/g · 77ccad4d
      CST 1998 Shawn T. Amundson authored
      Wed Dec 16 22:32:13 CST 1998 Shawn T. Amundson <amundson@gtk.org>
      
              * glib.h:
                giounix.c: s/g_main_poll_add/g_main_remove_add/g
                           s/g_main_poll_remove/g_main_remove_poll/g
                           s/g_main_poll_add_unlocking/g_main_add_unlocking_poll/g
                (from Tim Janik)
      
              * gthread-posix.c: use g_free in mutex_free (from Tim Janik)
      77ccad4d
  34. 15 Dec, 1998 2 commits
    • Sebastian Wilhelmi's avatar
      updated. · 2c30e862
      Sebastian Wilhelmi authored
      1998-12-15  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
      
      	* Makefile.am (EXTRA_DIST): updated.
      
      	* testgthread.c, gthread-*.c: Changed private to private_key to
      	avoid problems when compiling with under C++.
      2c30e862
    • Owen Taylor's avatar
      This commit merges the glib-threads branch into the main · 931ea952
      Owen Taylor authored
      branch. See the ChangeLog for details of the changes.
      
      In brief overview:
      
       - The set of threading functions can be set
       - A default implementation is provided in -lgthread
       - All static data structures are locked using these
         functions if g_thread_init() is called.
      931ea952