qemu-thread: Let qemu_thread_is_self() return bool
authorAndreas Färber <afaerber@suse.de>
Wed, 2 May 2012 15:21:31 +0000 (17:21 +0200)
committerAndreas Färber <afaerber@suse.de>
Thu, 2 Aug 2012 16:11:11 +0000 (18:11 +0200)
qemu_cpu_is_self(), passing the return value through, will later be
adapted to return bool as well.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
qemu-thread-posix.c
qemu-thread-win32.c
qemu-thread.h

index 9e1b5fb..8fbabda 100644 (file)
@@ -151,7 +151,7 @@ void qemu_thread_get_self(QemuThread *thread)
     thread->thread = pthread_self();
 }
 
-int qemu_thread_is_self(QemuThread *thread)
+bool qemu_thread_is_self(QemuThread *thread)
 {
    return pthread_equal(pthread_self(), thread->thread);
 }
index 3524c8b..177b398 100644 (file)
@@ -330,7 +330,7 @@ HANDLE qemu_thread_get_handle(QemuThread *thread)
     return handle;
 }
 
-int qemu_thread_is_self(QemuThread *thread)
+bool qemu_thread_is_self(QemuThread *thread)
 {
     return GetCurrentThreadId() == thread->tid;
 }
index a78a8f2..05fdaaf 100644 (file)
@@ -2,6 +2,7 @@
 #define __QEMU_THREAD_H 1
 
 #include <inttypes.h>
+#include <stdbool.h>
 
 typedef struct QemuMutex QemuMutex;
 typedef struct QemuCond QemuCond;
@@ -42,7 +43,7 @@ void qemu_thread_create(QemuThread *thread,
                         void *arg, int mode);
 void *qemu_thread_join(QemuThread *thread);
 void qemu_thread_get_self(QemuThread *thread);
-int qemu_thread_is_self(QemuThread *thread);
+bool qemu_thread_is_self(QemuThread *thread);
 void qemu_thread_exit(void *retval);
 
 #endif