Use encoding names which may work better on Solaris. (#340434, Alessandro
[platform/upstream/glib.git] / gthread / gthread-solaris.c
index c86c5bd..4f21798 100644 (file)
@@ -31,6 +31,8 @@
  * MT safe
  */
 
+#include <config.h>
+
 #include <thread.h>
 #include <errno.h>
 #include <stdlib.h>
@@ -54,6 +56,7 @@ static gulong g_thread_min_stack_size = 0;
 #define G_MUTEX_SIZE (sizeof (mutex_t))
 
 #define PRIORITY_LOW_VALUE 0
+#define PRIORITY_NORMAL_VALUE 50
 #define PRIORITY_URGENT_VALUE 127
 
 #define HAVE_G_THREAD_IMPL_INIT
@@ -61,6 +64,8 @@ static void
 g_thread_impl_init()
 {
   g_thread_min_stack_size = thr_min_stack();
+  /* The default priority on Solaris is 0. Set it to something sane */
+  solaris_check_for_error (thr_setprio (thr_self (), PRIORITY_NORMAL_VALUE));
 }
 
 static GMutex *