mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
thread: use pthread_equal to compare thread ids
This commit is contained in:
parent
edbfd180d0
commit
f2be2923e6
2 changed files with 3 additions and 3 deletions
|
|
@ -333,7 +333,7 @@ static void loop_enter(void *object)
|
||||||
impl->enter_count = 1;
|
impl->enter_count = 1;
|
||||||
} else {
|
} else {
|
||||||
spa_return_if_fail(impl->enter_count > 0);
|
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++;
|
impl->enter_count++;
|
||||||
}
|
}
|
||||||
spa_log_trace(impl->log, "%p: enter %p", impl, (void *) impl->thread);
|
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();
|
pthread_t thread_id = pthread_self();
|
||||||
|
|
||||||
spa_return_if_fail(impl->enter_count > 0);
|
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);
|
spa_log_trace(impl->log, "%p: leave %p", impl, (void *) impl->thread);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -480,5 +480,5 @@ void pw_thread_loop_accept(struct pw_thread_loop *loop)
|
||||||
SPA_EXPORT
|
SPA_EXPORT
|
||||||
bool pw_thread_loop_in_thread(struct pw_thread_loop *loop)
|
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());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue