mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-09 12:25:48 +01:00
Use GError to report errors as well.
2000-09-01 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * gthread-solaris.c (g_thread_create_solaris_impl): Use GError to report errors as well.
This commit is contained in:
parent
64bbfbb6da
commit
4d1cb41ef9
@ -3,6 +3,9 @@
|
|||||||
* gthread-posix.c (g_thread_create_posix_impl): Use GError to
|
* gthread-posix.c (g_thread_create_posix_impl): Use GError to
|
||||||
report errors.
|
report errors.
|
||||||
|
|
||||||
|
* gthread-solaris.c (g_thread_create_solaris_impl): Use GError to
|
||||||
|
report errors as well.
|
||||||
|
|
||||||
2000-05-13 Tor Lillqvist <tml@iki.fi>
|
2000-05-13 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
* makefile.mingw.in: New file, with gthread stuff moved from
|
* makefile.mingw.in: New file, with gthread stuff moved from
|
||||||
|
@ -287,13 +287,15 @@ g_thread_create_posix_impl (GThreadFunc thread_func,
|
|||||||
|
|
||||||
posix_check_for_error (pthread_attr_destroy (&attr));
|
posix_check_for_error (pthread_attr_destroy (&attr));
|
||||||
|
|
||||||
if (ret)
|
if (ret == EAGAIN)
|
||||||
{
|
{
|
||||||
g_set_error (error, G_THREAD_ERROR, G_THREAD_ERROR_AGAIN,
|
g_set_error (error, G_THREAD_ERROR, G_THREAD_ERROR_AGAIN,
|
||||||
"Error creating thread: %s", g_strerror (ret));
|
"Error creating thread: %s", g_strerror (ret));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
posix_check_for_error (ret);
|
||||||
|
|
||||||
#ifdef G_THREADS_IMPL_DCE
|
#ifdef G_THREADS_IMPL_DCE
|
||||||
if (!joinable)
|
if (!joinable)
|
||||||
posix_check_for_error (pthread_detach (thread));
|
posix_check_for_error (pthread_detach (thread));
|
||||||
|
@ -195,18 +195,28 @@ g_thread_create_solaris_impl (GThreadFunc thread_func,
|
|||||||
gboolean joinable,
|
gboolean joinable,
|
||||||
gboolean bound,
|
gboolean bound,
|
||||||
GThreadPriority priority,
|
GThreadPriority priority,
|
||||||
gpointer thread)
|
gpointer thread,
|
||||||
|
GError **error)
|
||||||
{
|
{
|
||||||
long flags = (bound ? THR_BOUND : 0) | (joinable ? 0: THR_DETACHED);
|
long flags = (bound ? THR_BOUND : 0) | (joinable ? 0: THR_DETACHED);
|
||||||
|
gint ret;
|
||||||
|
|
||||||
g_return_if_fail (thread_func);
|
g_return_if_fail (thread_func);
|
||||||
|
|
||||||
stack_size = MAX (g_thread_min_stack_size, stack_size);
|
stack_size = MAX (g_thread_min_stack_size, stack_size);
|
||||||
|
|
||||||
solaris_check_for_error (thr_create (NULL, stack_size,
|
ret = thr_create (NULL, stack_size, (void* (*)(void*))thread_func,
|
||||||
(void* (*)(void*))thread_func,
|
arg, flags, thread);
|
||||||
arg, flags, thread));
|
|
||||||
|
if (ret == EAGAIN)
|
||||||
|
{
|
||||||
|
g_set_error (error, G_THREAD_ERROR, G_THREAD_ERROR_AGAIN,
|
||||||
|
"Error creating thread: %s", g_strerror (ret));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
solaris_check_for_error (ret);
|
||||||
|
|
||||||
g_thread_set_priority_solaris_impl (thread, priority);
|
g_thread_set_priority_solaris_impl (thread, priority);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user