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.
This commit is contained in:
Thomas Weißschuh 2023-02-03 00:28:56 +00:00
parent 04e769ff35
commit 38f88d3d25
2 changed files with 2 additions and 2 deletions

View file

@ -435,7 +435,7 @@ int pw_thread_loop_get_time(struct pw_thread_loop *loop, struct timespec *abstim
* *
*/ */
SPA_EXPORT 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; int ret;
loop->n_waiting++; loop->n_waiting++;

View file

@ -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 /** 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. * \ref pw_thread_loop_signal. Use \ref pw_thread_loop_get_time to make a timeout.
* Since: 0.3.7 */ * 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 */ /** Signal all threads waiting with \ref pw_thread_loop_wait */
void pw_thread_loop_signal(struct pw_thread_loop *loop, bool wait_for_accept); void pw_thread_loop_signal(struct pw_thread_loop *loop, bool wait_for_accept);