Add thread_equal function to allow for platform defined function to

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.
This commit is contained in:
Sebastian Wilhelmi
2001-09-19 12:46:39 +00:00
committed by Sebastian Wilhelmi
parent 5ad6ec44c6
commit f8f4c3778a
15 changed files with 98 additions and 9 deletions

View File

@@ -1,3 +1,11 @@
2001-09-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gthread-posix.c: Add g_thread_equal_posix_impl and add to the
function vector g_thread_functions_for_glib_use_default.
* gthread-solaris.c, gthread-win32.c: Add NULL as equal function,
as on those two platforms you don't need an equal function.
2001-09-19 Tor Lillqvist <tml@iki.fi>
* gthread.rc.in: Correct InternalName and OriginalFilename to

View File

@@ -383,6 +383,12 @@ g_thread_self_posix_impl (gpointer thread)
*(pthread_t*)thread = pthread_self();
}
static gboolean
g_thread_equal_posix_impl (gpointer thread1, gpointer thread2)
{
return (pthread_equal (*(pthread_t*)thread1, *(pthread_t*)thread2) != 0);
}
static GThreadFunctions g_thread_functions_for_glib_use_default =
{
g_mutex_new_posix_impl,
@@ -404,5 +410,6 @@ static GThreadFunctions g_thread_functions_for_glib_use_default =
g_thread_join_posix_impl,
g_thread_exit_posix_impl,
g_thread_set_priority_posix_impl,
g_thread_self_posix_impl
g_thread_self_posix_impl,
g_thread_equal_posix_impl
};

View File

@@ -270,5 +270,6 @@ static GThreadFunctions g_thread_functions_for_glib_use_default =
g_thread_join_solaris_impl,
g_thread_exit_solaris_impl,
g_thread_set_priority_solaris_impl,
g_thread_self_solaris_impl
g_thread_self_solaris_impl,
NULL /* no equal function necessary on Solaris */
};

View File

@@ -521,7 +521,8 @@ static GThreadFunctions g_thread_functions_for_glib_use_default =
g_thread_join_win32_impl,
g_thread_exit_win32_impl,
g_thread_set_priority_win32_impl,
g_thread_self_win32_impl
g_thread_self_win32_impl,
NULL /* no equal function necessary */
};
#define HAVE_G_THREAD_IMPL_INIT