aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2009-06-04 11:51:56 -0700
committerRiku Voipio <riku.voipio@nokia.com>2009-06-16 16:58:45 +0300
commitdf377d0354b8572bd448e85afae72d43d6e071ab (patch)
tree7a49e2d442e6d010c7f1b5951a61d29318fb43fd /linux-user
parent5f10681186e3a993b534c58ef0a57477ea47e505 (diff)
downloadqemu-df377d0354b8572bd448e85afae72d43d6e071ab.zip
qemu-df377d0354b8572bd448e85afae72d43d6e071ab.tar.gz
qemu-df377d0354b8572bd448e85afae72d43d6e071ab.tar.bz2
linux-user: initialize mmap_mutex properly
We initialize mmap_mutex in any child threads/processes, but we need to correctly statically initialize it for the original process. Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/mmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index aa5813f..aa22006 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -36,7 +36,7 @@
//#define DEBUG_MMAP
#if defined(USE_NPTL)
-pthread_mutex_t mmap_mutex;
+pthread_mutex_t mmap_mutex = PTHREAD_MUTEX_INITIALIZER;
static int __thread mmap_lock_count;
void mmap_lock(void)