提交 2d797b65 编写于 作者: A Andreas Färber

qemu-thread: Let qemu_thread_is_self() return bool

qemu_cpu_is_self(), passing the return value through, will later be
adapted to return bool as well.
Signed-off-by: NAndreas Färber <afaerber@suse.de>
Reviewed-by: NStefan Weil <sw@weilnetz.de>
上级 02d2bd5d
......@@ -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);
}
......
......@@ -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;
}
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册