diff mbox series

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

Message ID 20250120061310.81368-3-philmd@linaro.org (mailing list archive)
State New
Headers show
Series cpus: Constify some CPUState arguments | expand

Commit Message

Philippe Mathieu-Daudé Jan. 20, 2025, 6:13 a.m. UTC
QemuThread structure is not modified, only read.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 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 mbox series

Patch

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;
 }