thread: use pthread_equal to compare thread ids

This commit is contained in:
Wim Taymans 2023-04-04 12:43:25 +02:00
parent edbfd180d0
commit f2be2923e6
2 changed files with 3 additions and 3 deletions

View file

@ -333,7 +333,7 @@ static void loop_enter(void *object)
impl->enter_count = 1;
} else {
spa_return_if_fail(impl->enter_count > 0);
spa_return_if_fail(impl->thread == thread_id);
spa_return_if_fail(pthread_equal(impl->thread, thread_id));
impl->enter_count++;
}
spa_log_trace(impl->log, "%p: enter %p", impl, (void *) impl->thread);
@ -345,7 +345,7 @@ static void loop_leave(void *object)
pthread_t thread_id = pthread_self();
spa_return_if_fail(impl->enter_count > 0);
spa_return_if_fail(impl->thread == thread_id);
spa_return_if_fail(pthread_equal(impl->thread, thread_id));
spa_log_trace(impl->log, "%p: leave %p", impl, (void *) impl->thread);

View file

@ -480,5 +480,5 @@ void pw_thread_loop_accept(struct pw_thread_loop *loop)
SPA_EXPORT
bool pw_thread_loop_in_thread(struct pw_thread_loop *loop)
{
return loop->running && pthread_self() == loop->thread;
return loop->running && pthread_equal(loop->thread, pthread_self());
}