diff options
author | Sebastian Wilhelmi <wilhelmi@ira.uka.de> | 2000-11-09 12:28:12 +0000 |
---|---|---|
committer | Sebastian Wilhelmi <wilhelmi@src.gnome.org> | 2000-11-09 12:28:12 +0000 |
commit | c46b9f34e4ac5f0b869fe6077973336d5e1cead8 (patch) | |
tree | 26f3e774b6d07577c974940c22e0ed7f730d3452 /glib | |
parent | 14c4da8cdd8b76b765370048fb45fa741b899dad (diff) | |
download | glib-c46b9f34e4ac5f0b869fe6077973336d5e1cead8.tar.gz |
Don't take threads with other priorities into account as changing the
2000-11-09 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gthreadpool.c: Don't take threads with other priorities into
account as changing the priority is highly unportable. (Actually
using it at all already is unportable, but even sometimes where
that works, changing priority is not possible).
Diffstat (limited to 'glib')
-rw-r--r-- | glib/gthreadpool.c | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/glib/gthreadpool.c b/glib/gthreadpool.c index d1a4d2c24..1d8422949 100644 --- a/glib/gthreadpool.c +++ b/glib/gthreadpool.c @@ -151,9 +151,6 @@ g_thread_pool_thread_proxy (gpointer data) g_async_queue_lock (pool->queue); - if (pool->pool.priority != self->priority) - g_thread_set_priority (self, pool->pool.priority); - /* pool->num_threads++ is not done here, but in * g_thread_pool_start_thread to make the new started thread * known to the pool, before itself can do it. */ @@ -184,28 +181,9 @@ g_thread_pool_start_thread (GRealThreadPool *pool, g_async_queue_unlock (queue); - if (!success) - { - /* Now we search for threads with other priorities too, but - * only, when there is more than one unused thread with that - * priority. */ - GThreadPriority priority; - for (priority = G_THREAD_PRIORITY_LOW; - priority < G_THREAD_PRIORITY_URGENT + 1; priority++) - { - queue = unused_thread_queue[priority]; - g_async_queue_lock (queue); - - if (g_async_queue_length_unlocked (queue) < -1) - { - g_async_queue_push_unlocked (queue, pool); - success = TRUE; - } - - g_async_queue_unlock (queue); - } - } - + /* We will not search for threads with other priorities, because changing + * priority is quite unportable */ + if (!success) { GError *local_error = NULL; @@ -251,7 +229,6 @@ g_thread_pool_new (GFunc thread_func, retval->pool.priority = priority; retval->pool.exclusive = exclusive; retval->pool.user_data = user_data; - retval->queue = g_async_queue_new (); retval->max_threads = max_threads; retval->num_threads = 0; |