replace spinlock by QemuMutex.

spinlock is only used in two cases:
  * cpu-exec.c: to protect TranslationBlock
  * mem_helper.c: for lock helper in target-i386 (which seems broken).

It's a pthread_mutex_t in user-mode, so we can use QemuMutex directly,
with an #ifdef.  The #ifdef will be removed when multithreaded TCG
will need the mutex as well.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Message-Id: <1439220437-23957-5-git-send-email-fred.konrad@greensocs.com>
Signed-off-by: Emilio G. Cota <cota@braap.org>
[Merge Emilio G. Cota's patch to remove volatile. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
KONRAD Frederic 2015-08-10 17:27:02 +02:00 committed by Paolo Bonzini
parent d5f8d61390
commit 677ef6230b
8 changed files with 73 additions and 19 deletions

View file

@ -595,6 +595,10 @@ void *tcg_malloc_internal(TCGContext *s, int size);
void tcg_pool_reset(TCGContext *s);
void tcg_pool_delete(TCGContext *s);
void tb_lock(void);
void tb_unlock(void);
void tb_lock_reset(void);
static inline void *tcg_malloc(int size)
{
TCGContext *s = &tcg_ctx;