From: Havoc Pennington Date: Wed, 13 Dec 2000 04:23:45 +0000 (+0000) Subject: don't try to use thread stuff unless G_THREADS_ENABLED X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=9edb08492d09a36caf389f639f45c8c1c8315f10;p=dana%2Fcg-glib.git don't try to use thread stuff unless G_THREADS_ENABLED 2000-12-12 Havoc Pennington * gmain.c (g_main_context_destroy): don't try to use thread stuff unless G_THREADS_ENABLED (g_main_context_query): ditto (g_main_context_check): ditto (g_main_loop_quit): ditto --- diff --git a/ChangeLog b/ChangeLog index 4dca3db4..d44e5fa3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2000-12-12 Havoc Pennington + + * gmain.c (g_main_context_destroy): don't try to use thread stuff + unless G_THREADS_ENABLED + (g_main_context_query): ditto + (g_main_context_check): ditto + (g_main_loop_quit): ditto + Tue Dec 12 18:58:22 2000 Tim Janik * ghash.c (g_hash_table_remove): return whether a value diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 4dca3db4..d44e5fa3 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,11 @@ +2000-12-12 Havoc Pennington + + * gmain.c (g_main_context_destroy): don't try to use thread stuff + unless G_THREADS_ENABLED + (g_main_context_query): ditto + (g_main_context_check): ditto + (g_main_loop_quit): ditto + Tue Dec 12 18:58:22 2000 Tim Janik * ghash.c (g_hash_table_remove): return whether a value diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 4dca3db4..d44e5fa3 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +2000-12-12 Havoc Pennington + + * gmain.c (g_main_context_destroy): don't try to use thread stuff + unless G_THREADS_ENABLED + (g_main_context_query): ditto + (g_main_context_check): ditto + (g_main_loop_quit): ditto + Tue Dec 12 18:58:22 2000 Tim Janik * ghash.c (g_hash_table_remove): return whether a value diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 4dca3db4..d44e5fa3 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,11 @@ +2000-12-12 Havoc Pennington + + * gmain.c (g_main_context_destroy): don't try to use thread stuff + unless G_THREADS_ENABLED + (g_main_context_query): ditto + (g_main_context_check): ditto + (g_main_loop_quit): ditto + Tue Dec 12 18:58:22 2000 Tim Janik * ghash.c (g_hash_table_remove): return whether a value diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 4dca3db4..d44e5fa3 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,11 @@ +2000-12-12 Havoc Pennington + + * gmain.c (g_main_context_destroy): don't try to use thread stuff + unless G_THREADS_ENABLED + (g_main_context_query): ditto + (g_main_context_check): ditto + (g_main_loop_quit): ditto + Tue Dec 12 18:58:22 2000 Tim Janik * ghash.c (g_hash_table_remove): return whether a value diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 4dca3db4..d44e5fa3 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +2000-12-12 Havoc Pennington + + * gmain.c (g_main_context_destroy): don't try to use thread stuff + unless G_THREADS_ENABLED + (g_main_context_query): ditto + (g_main_context_check): ditto + (g_main_loop_quit): ditto + Tue Dec 12 18:58:22 2000 Tim Janik * ghash.c (g_hash_table_remove): return whether a value diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 4dca3db4..d44e5fa3 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +2000-12-12 Havoc Pennington + + * gmain.c (g_main_context_destroy): don't try to use thread stuff + unless G_THREADS_ENABLED + (g_main_context_query): ditto + (g_main_context_check): ditto + (g_main_loop_quit): ditto + Tue Dec 12 18:58:22 2000 Tim Janik * ghash.c (g_hash_table_remove): return whether a value diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 4dca3db4..d44e5fa3 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +2000-12-12 Havoc Pennington + + * gmain.c (g_main_context_destroy): don't try to use thread stuff + unless G_THREADS_ENABLED + (g_main_context_query): ditto + (g_main_context_check): ditto + (g_main_loop_quit): ditto + Tue Dec 12 18:58:22 2000 Tim Janik * ghash.c (g_hash_table_remove): return whether a value diff --git a/glib/gmain.c b/glib/gmain.c index f9b26dd1..9c60b870 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -514,6 +514,7 @@ g_main_context_destroy (GMainContext *context) g_mem_chunk_destroy (context->poll_chunk); +#ifdef G_THREADS_ENABLED if (g_thread_supported()) { #ifndef G_OS_WIN32 @@ -523,6 +524,7 @@ g_main_context_destroy (GMainContext *context) CloseHandle (context->wake_up_semaphore); #endif } +#endif g_free (context); } @@ -1735,8 +1737,10 @@ g_main_context_query (GMainContext *context, pollrec = pollrec->next; } +#ifdef G_THREADS_ENABLED context->poll_changed = FALSE; - +#endif + if (timeout) { *timeout = context->timeout; @@ -1791,14 +1795,14 @@ g_main_context_check (GMainContext *context, } else context->poll_waiting = FALSE; -#endif /* G_THREADS_ENABLED */ /* If the set of poll file descriptors changed, bail out * and let the main loop rerun */ if (context->poll_changed) return 0; - +#endif /* G_THREADS_ENABLED */ + pollrec = context->poll_records; i = 0; while (i < n_fds) @@ -2093,8 +2097,10 @@ g_main_loop_quit (GMainLoop *loop) LOCK_LOOP (loop); loop->is_running = FALSE; +#ifdef G_THREADS_ENABLED if (loop->sem_cond) g_cond_broadcast (loop->sem_cond); +#endif UNLOCK_LOOP (loop); diff --git a/gmain.c b/gmain.c index f9b26dd1..9c60b870 100644 --- a/gmain.c +++ b/gmain.c @@ -514,6 +514,7 @@ g_main_context_destroy (GMainContext *context) g_mem_chunk_destroy (context->poll_chunk); +#ifdef G_THREADS_ENABLED if (g_thread_supported()) { #ifndef G_OS_WIN32 @@ -523,6 +524,7 @@ g_main_context_destroy (GMainContext *context) CloseHandle (context->wake_up_semaphore); #endif } +#endif g_free (context); } @@ -1735,8 +1737,10 @@ g_main_context_query (GMainContext *context, pollrec = pollrec->next; } +#ifdef G_THREADS_ENABLED context->poll_changed = FALSE; - +#endif + if (timeout) { *timeout = context->timeout; @@ -1791,14 +1795,14 @@ g_main_context_check (GMainContext *context, } else context->poll_waiting = FALSE; -#endif /* G_THREADS_ENABLED */ /* If the set of poll file descriptors changed, bail out * and let the main loop rerun */ if (context->poll_changed) return 0; - +#endif /* G_THREADS_ENABLED */ + pollrec = context->poll_records; i = 0; while (i < n_fds) @@ -2093,8 +2097,10 @@ g_main_loop_quit (GMainLoop *loop) LOCK_LOOP (loop); loop->is_running = FALSE; +#ifdef G_THREADS_ENABLED if (loop->sem_cond) g_cond_broadcast (loop->sem_cond); +#endif UNLOCK_LOOP (loop);