qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-1.2 1/4] qemu-thread: Let qemu_thread_is_sel


From: Stefan Weil
Subject: Re: [Qemu-devel] [PATCH for-1.2 1/4] qemu-thread: Let qemu_thread_is_self() return bool
Date: Thu, 02 Aug 2012 08:27:28 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0

Am 02.08.2012 02:48, schrieb Andreas Färber:
qemu_cpu_is_self(), passing the return value through, will later be
adapted to return bool as well.

Signed-off-by: Andreas Färber <address@hidden>
---
  qemu-thread-posix.c |    2 +-
  qemu-thread-win32.c |    2 +-
  qemu-thread.h       |    3 ++-
  3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/qemu-thread-posix.c b/qemu-thread-posix.c
index 9e1b5fb..8fbabda 100644
--- a/qemu-thread-posix.c
+++ b/qemu-thread-posix.c
@@ -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);
  }
diff --git a/qemu-thread-win32.c b/qemu-thread-win32.c
index 3524c8b..177b398 100644
--- a/qemu-thread-win32.c
+++ b/qemu-thread-win32.c
@@ -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;
  }
diff --git a/qemu-thread.h b/qemu-thread.h
index a78a8f2..05fdaaf 100644
--- a/qemu-thread.h
+++ b/qemu-thread.h
@@ -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

Reviewed-by: Stefan Weil <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]