[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/13] gui: Call g_thread_init() earlier.
From: |
Ben Pfaff |
Subject: |
[PATCH 04/13] gui: Call g_thread_init() earlier. |
Date: |
Mon, 16 Apr 2012 20:52:10 -0700 |
The GTK+ 2.20 manual says:
The threading system is initialized with g_thread_init(), which takes
an optional custom thread implementation or NULL for the default
implementation. If you want to call g_thread_init() with a non-NULL
argument this must be done before executing any other GLib functions
(except g_mem_set_vtable()). This is a requirement even if no threads
are in fact ever created by the process.
Calling g_thread_init() with a NULL argument is somewhat more
relaxed. You may call any other glib functions in the main thread
before g_thread_init() as long as g_thread_init() is not called from a
glib callback, or with any locks held. However, many libraries above
glib does not support late initialization of threads, so doing this
should be avoided if possible.
so I think that it's best to call g_thread_init() before
gtk_disable_setlocale() rather than after.
---
src/ui/gui/main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/ui/gui/main.c b/src/ui/gui/main.c
index eea71f8..5e0116b 100644
--- a/src/ui/gui/main.c
+++ b/src/ui/gui/main.c
@@ -278,10 +278,10 @@ main (int argc, char *argv[])
set_program_name (argv[0]);
g_mem_set_vtable (&vtable);
+ g_thread_init (NULL);
gtk_disable_setlocale ();
- g_thread_init (NULL);
startup = g_timer_new ();
g_timer_start (startup);
--
1.7.2.5
- Re: [PATCH 01/13] psppire-dict: g_return_if_fail for idx in psppire_dict_get_variable()., (continued)
- Re: [PATCH 01/13] psppire-dict: g_return_if_fail for idx in psppire_dict_get_variable()., John Darrington, 2012/04/17
- Re: [PATCH 01/13] psppire-dict: g_return_if_fail for idx in psppire_dict_get_variable()., Ben Pfaff, 2012/04/18
- Re: [PATCH 01/13] psppire-dict: g_return_if_fail for idx in psppire_dict_get_variable()., John Darrington, 2012/04/18
- Re: [PATCH 01/13] psppire-dict: g_return_if_fail for idx in psppire_dict_get_variable()., Ben Pfaff, 2012/04/19
- Re: [PATCH 01/13] psppire-dict: g_return_if_fail for idx in psppire_dict_get_variable()., Ben Pfaff, 2012/04/21
- Re: [PATCH 01/13] psppire-dict: g_return_if_fail for idx in psppire_dict_get_variable()., John Darrington, 2012/04/21
[PATCH 02/13] gui: Use canonical names for signals., Ben Pfaff, 2012/04/16
[PATCH 03/13] gui: Add undocumented --measure-startup option., Ben Pfaff, 2012/04/16
[PATCH 04/13] gui: Call g_thread_init() earlier.,
Ben Pfaff <=
[PATCH 05/13] format: New functions fmt_change_width(), fmt_change_decimals()., Ben Pfaff, 2012/04/16
[PATCH 07/13] format: Fix typo in comment., Ben Pfaff, 2012/04/16
[PATCH 08/13] helper: New function value_to_text__()., Ben Pfaff, 2012/04/16
[PATCH 09/13] value-labels: New function val_labs_find_value()., Ben Pfaff, 2012/04/16
[PATCH 06/13] format: Introduce a new type "enum fmt_use"., Ben Pfaff, 2012/04/16
[PATCH 10/13] abt: Drop child parameters from 'reaugment' function., Ben Pfaff, 2012/04/16
[PATCH 11/13] abt: New function abt_is_empty()., Ben Pfaff, 2012/04/16
[PATCH 12/13] range-set: Rename "insert" function "set1", "delete" to "set0"., Ben Pfaff, 2012/04/16
[PATCH 13/13] range-set: New macro RANGE_SET_FOR_EACH to make iteration easier., Ben Pfaff, 2012/04/16
Re: [PATCH 00/13] second batch of psppsheet changes, John Darrington, 2012/04/18