Don't use g_thread_get_initialized.

Initialize glib threads unconditionally in main() instead
of using g_thread_get_initialized in the 9p code.

Fixes a build failure on RHEL-5, which ships glib 2.12.
g_thread_get_initialized was added in 2.20.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Gerd Hoffmann 2011-09-07 15:02:15 +02:00 committed by Anthony Liguori
parent 36b586284e
commit ad8b818686
2 changed files with 1 additions and 4 deletions

View File

@ -67,10 +67,6 @@ int v9fs_init_worker_threads(void)
/* Leave signal handling to the iothread. */ /* Leave signal handling to the iothread. */
pthread_sigmask(SIG_SETMASK, &set, &oldset); pthread_sigmask(SIG_SETMASK, &set, &oldset);
/* init thread system if not already initialized */
if (!g_thread_get_initialized()) {
g_thread_init(NULL);
}
if (qemu_pipe(notifier_fds) == -1) { if (qemu_pipe(notifier_fds) == -1) {
ret = -1; ret = -1;
goto err_out; goto err_out;

1
vl.c
View File

@ -2200,6 +2200,7 @@ int main(int argc, char **argv, char **envp)
error_set_progname(argv[0]); error_set_progname(argv[0]);
g_mem_set_vtable(&mem_trace); g_mem_set_vtable(&mem_trace);
g_thread_init(NULL);
init_clocks(); init_clocks();