]>
Commit | Line | Data |
---|---|---|
ba4191c3 JR |
1 | --- amanda/trunk/common-src/glib-util.c 2009/10/16 22:06:51 2182 |
2 | +++ amanda/trunk/common-src/glib-util.c 2010/05/03 21:42:31 2982 | |
ba4191c3 JR |
3 | @@ -38,26 +38,15 @@ |
4 | if (did_glib_init) return; | |
5 | did_glib_init = TRUE; | |
6 | ||
7 | - /* Initialize glib's type system */ | |
8 | - g_type_init(); | |
9 | - | |
10 | /* set up libcurl (this must happen before threading | |
11 | * is initialized) */ | |
12 | #ifdef HAVE_LIBCURL | |
13 | # ifdef G_THREADS_ENABLED | |
14 | - g_assert(!g_thread_supported()); | |
15 | + g_assert(!g_thread_supported()); /* assert threads aren't initialized yet */ | |
16 | # endif | |
17 | g_assert(curl_global_init(CURL_GLOBAL_ALL) == 0); | |
18 | #endif | |
19 | ||
20 | - /* And set up glib's threads */ | |
21 | -#if defined(G_THREADS_ENABLED) && !defined(G_THREADS_IMPL_NONE) | |
22 | - if (g_thread_supported()) { | |
23 | - return; | |
24 | - } | |
25 | - g_thread_init(NULL); | |
26 | -#endif | |
27 | - | |
28 | /* do a version check */ | |
29 | #if GLIB_CHECK_VERSION(2,6,0) | |
30 | { | |
31 | @@ -71,6 +60,16 @@ | |
32 | } | |
33 | } | |
34 | #endif | |
35 | + | |
36 | + /* Initialize glib's type system. On glib >= 2.24, this will initialize | |
37 | + * threads, so it must be done after curl is initialized. */ | |
38 | + g_type_init(); | |
39 | + | |
40 | + /* And set up glib's threads */ | |
41 | +#if defined(G_THREADS_ENABLED) && !defined(G_THREADS_IMPL_NONE) | |
42 | + if (!g_thread_supported()) | |
43 | + g_thread_init(NULL); | |
44 | +#endif | |
45 | } | |
46 | ||
47 | typedef enum { |