Stefan Hajnoczi ae2990c259 osdep: initialize glib threads in all QEMU tools
glib versions prior to 2.31.0 require an explicit g_thread_init() call
to enable multi-threading.

Failure to initialize threading causes glib to take single-threaded code
paths without synchronization.  For example, the g_slice allocator will
crash due to race conditions.

Fix this for all QEMU tool programs (qemu-nbd, qemu-io, qemu-img) by
moving the g_thread_init() call from vl.c:main() into a new
osdep.c:thread_init() constructor function.

thread_init() has __attribute__((constructor)) and is automatically
invoked by the runtime during startup.

We can now drop the "simple" trace backend's g_thread_init() call since
thread_init() already called it.

Note that we must keep coroutine-gthread.c's g_thread_init() call which
is located in a constructor function.  There is no guarantee for
constructor function ordering so thread_init() may only be called later.

Reported-by: Mario de Chenno <mario.dechenno@unina2.it>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-03-25 13:39:31 +01:00
2014-03-24 19:25:09 +00:00
2014-03-24 19:00:02 +00:00
2014-03-12 16:45:25 +00:00
2014-03-13 20:15:37 +01:00
2014-03-03 09:46:27 +04:00
2014-03-13 20:15:37 +01:00
2014-03-24 16:34:01 +00:00
2014-03-24 19:00:02 +00:00
2014-03-12 17:26:32 +01:00
2014-03-19 19:47:15 +01:00
2014-03-13 14:42:24 +01:00
2014-03-17 11:50:19 +00:00
2014-03-13 14:42:24 +01:00
2014-02-21 21:02:23 +01:00
2014-03-13 14:34:16 +00:00
2014-02-25 14:30:28 +01:00
2014-03-17 13:21:11 +01:00
2013-12-04 15:19:00 +01:00
2014-03-05 03:06:24 +01:00
2014-02-17 11:57:23 -05:00
2014-03-13 20:08:15 -07:00

Read the documentation in qemu-doc.html or on http://wiki.qemu-project.org

- QEMU team
Description
No description provided
Readme 404 MiB
Languages
C 82.6%
C++ 6.5%
Python 3.4%
Dylan 2.9%
Shell 1.6%
Other 2.8%