[PATCH 2/7] qemu/thread: Constify qemu_thread_is_self() argument

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

 



QemuThread structure is not modified, only read.

Signed-off-by: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>
---
 include/qemu/thread.h    | 2 +-
 util/qemu-thread-posix.c | 2 +-
 util/qemu-thread-win32.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/qemu/thread.h b/include/qemu/thread.h
index d4f44241ef0..d3027c843bc 100644
--- a/include/qemu/thread.h
+++ b/include/qemu/thread.h
@@ -195,7 +195,7 @@ int qemu_thread_get_affinity(const QemuThread *thread,
                              unsigned long **host_cpus, unsigned long *nbits);
 void *qemu_thread_join(QemuThread *thread);
 void qemu_thread_get_self(QemuThread *thread);
-bool qemu_thread_is_self(QemuThread *thread);
+bool qemu_thread_is_self(const QemuThread *thread);
 G_NORETURN void qemu_thread_exit(void *retval);
 void qemu_thread_naming(bool enable);
 
diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c
index 0fc3003ec46..c85421f1a0f 100644
--- a/util/qemu-thread-posix.c
+++ b/util/qemu-thread-posix.c
@@ -664,7 +664,7 @@ void qemu_thread_get_self(QemuThread *thread)
     thread->thread = pthread_self();
 }
 
-bool qemu_thread_is_self(QemuThread *thread)
+bool qemu_thread_is_self(const QemuThread *thread)
 {
    return pthread_equal(pthread_self(), thread->thread);
 }
diff --git a/util/qemu-thread-win32.c b/util/qemu-thread-win32.c
index 0d512c0188e..08c6543fe51 100644
--- a/util/qemu-thread-win32.c
+++ b/util/qemu-thread-win32.c
@@ -546,7 +546,7 @@ HANDLE qemu_thread_get_handle(QemuThread *thread)
     return handle;
 }
 
-bool qemu_thread_is_self(QemuThread *thread)
+bool qemu_thread_is_self(const QemuThread *thread)
 {
     return GetCurrentThreadId() == thread->tid;
 }
-- 
2.47.1





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux