diff options
Diffstat (limited to 'linux-user/main.c')
-rw-r--r-- | linux-user/main.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/linux-user/main.c b/linux-user/main.c index 6e2984c44b..2c1e4df6e5 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -143,6 +143,7 @@ int64_t cpu_get_real_ticks(void) We don't require a full sync, only that no cpus are executing guest code. The alternative is to map target atomic ops onto host equivalents, which requires quite a lot of per host/target work. */ +static pthread_mutex_t cpu_list_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t exclusive_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t exclusive_cond = PTHREAD_COND_INITIALIZER; static pthread_cond_t exclusive_resume = PTHREAD_COND_INITIALIZER; @@ -165,6 +166,7 @@ void fork_end(int child) thread_env->next_cpu = NULL; pending_cpus = 0; pthread_mutex_init(&exclusive_lock, NULL); + pthread_mutex_init(&cpu_list_mutex, NULL); pthread_cond_init(&exclusive_cond, NULL); pthread_cond_init(&exclusive_resume, NULL); pthread_mutex_init(&tb_lock, NULL); @@ -237,6 +239,16 @@ static inline void cpu_exec_end(CPUState *env) exclusive_idle(); pthread_mutex_unlock(&exclusive_lock); } + +void cpu_list_lock(void) +{ + pthread_mutex_lock(&cpu_list_mutex); +} + +void cpu_list_unlock(void) +{ + pthread_mutex_unlock(&cpu_list_mutex); +} #else /* if !USE_NPTL */ /* These are no-ops because we are not threadsafe. */ static inline void cpu_exec_start(CPUState *env) @@ -265,6 +277,14 @@ void fork_end(int child) gdbserver_fork(thread_env); } } + +void cpu_list_lock(void) +{ +} + +void cpu_list_unlock(void) +{ +} #endif |