mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-11 13:30:07 -05:00
thread-loop: add some debug
This commit is contained in:
parent
ef307d37bc
commit
1cdb7e0214
1 changed files with 5 additions and 0 deletions
|
|
@ -222,6 +222,7 @@ void pw_thread_loop_stop(struct pw_thread_loop *loop)
|
||||||
void pw_thread_loop_lock(struct pw_thread_loop *loop)
|
void pw_thread_loop_lock(struct pw_thread_loop *loop)
|
||||||
{
|
{
|
||||||
pthread_mutex_lock(&loop->lock);
|
pthread_mutex_lock(&loop->lock);
|
||||||
|
pw_log_trace("thread-loop: %p", loop);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Unlock the mutex associated with \a loop
|
/** Unlock the mutex associated with \a loop
|
||||||
|
|
@ -232,6 +233,7 @@ void pw_thread_loop_lock(struct pw_thread_loop *loop)
|
||||||
*/
|
*/
|
||||||
void pw_thread_loop_unlock(struct pw_thread_loop *loop)
|
void pw_thread_loop_unlock(struct pw_thread_loop *loop)
|
||||||
{
|
{
|
||||||
|
pw_log_trace("thread-loop: %p", loop);
|
||||||
pthread_mutex_unlock(&loop->lock);
|
pthread_mutex_unlock(&loop->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -247,6 +249,7 @@ void pw_thread_loop_unlock(struct pw_thread_loop *loop)
|
||||||
*/
|
*/
|
||||||
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)
|
||||||
{
|
{
|
||||||
|
pw_log_trace("thread-loop: %p, waiting %d", loop, loop->n_waiting);
|
||||||
if (loop->n_waiting > 0)
|
if (loop->n_waiting > 0)
|
||||||
pthread_cond_broadcast(&loop->cond);
|
pthread_cond_broadcast(&loop->cond);
|
||||||
|
|
||||||
|
|
@ -266,9 +269,11 @@ void pw_thread_loop_signal(struct pw_thread_loop *loop, bool wait_for_accept)
|
||||||
*/
|
*/
|
||||||
void pw_thread_loop_wait(struct pw_thread_loop *loop)
|
void pw_thread_loop_wait(struct pw_thread_loop *loop)
|
||||||
{
|
{
|
||||||
|
pw_log_trace("thread-loop: %p, waiting %d", loop, loop->n_waiting);
|
||||||
loop->n_waiting++;
|
loop->n_waiting++;
|
||||||
pthread_cond_wait(&loop->cond, &loop->lock);
|
pthread_cond_wait(&loop->cond, &loop->lock);
|
||||||
loop->n_waiting--;
|
loop->n_waiting--;
|
||||||
|
pw_log_trace("thread-loop: %p, waiting done %d", loop, loop->n_waiting);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Wait for the loop thread to call \ref pw_thread_loop_signal()
|
/** Wait for the loop thread to call \ref pw_thread_loop_signal()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue