From 38f88d3d252d0117b0049ad07b336d915e35affa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Fri, 3 Feb 2023 00:28:56 +0000 Subject: [PATCH] thread-loop: constify timespec argument This makes it easier for the user to see that pw_thread_loop_get_time() does not modify the timespec so that it can be reused over multiple calls. --- src/pipewire/thread-loop.c | 2 +- src/pipewire/thread-loop.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pipewire/thread-loop.c b/src/pipewire/thread-loop.c index 2fdd50e22..8de378696 100644 --- a/src/pipewire/thread-loop.c +++ b/src/pipewire/thread-loop.c @@ -435,7 +435,7 @@ int pw_thread_loop_get_time(struct pw_thread_loop *loop, struct timespec *abstim * */ SPA_EXPORT -int pw_thread_loop_timed_wait_full(struct pw_thread_loop *loop, struct timespec *abstime) +int pw_thread_loop_timed_wait_full(struct pw_thread_loop *loop, const struct timespec *abstime) { int ret; loop->n_waiting++; diff --git a/src/pipewire/thread-loop.h b/src/pipewire/thread-loop.h index 13e8532ca..00db3b2dc 100644 --- a/src/pipewire/thread-loop.h +++ b/src/pipewire/thread-loop.h @@ -153,7 +153,7 @@ int pw_thread_loop_get_time(struct pw_thread_loop *loop, struct timespec *abstim /** Release the lock and wait up to \a abstime until some thread calls * \ref pw_thread_loop_signal. Use \ref pw_thread_loop_get_time to make a timeout. * Since: 0.3.7 */ -int pw_thread_loop_timed_wait_full(struct pw_thread_loop *loop, struct timespec *abstime); +int pw_thread_loop_timed_wait_full(struct pw_thread_loop *loop, const struct timespec *abstime); /** Signal all threads waiting with \ref pw_thread_loop_wait */ void pw_thread_loop_signal(struct pw_thread_loop *loop, bool wait_for_accept);