dm vdo: fold thread-cond-var.c into thread-utils

Further cleanup is needed for thread-utils interfaces given many
functions should return void or be removed entirely because they
amount to obfuscation via wrappers.

Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Matthew Sakai <msakai@redhat.com>
This commit is contained in:
Mike Snitzer
2024-02-09 09:54:53 -06:00
parent 8e6333af19
commit 877f36b764
4 changed files with 34 additions and 52 deletions

View File

@@ -135,3 +135,14 @@ int uds_join_threads(struct thread *thread)
uds_free(thread);
return UDS_SUCCESS;
}
void uds_wait_cond(struct cond_var *cv, struct mutex *mutex)
{
DEFINE_WAIT(__wait);
prepare_to_wait(&cv->wait_queue, &__wait, TASK_IDLE);
uds_unlock_mutex(mutex);
schedule();
finish_wait(&cv->wait_queue, &__wait);
uds_lock_mutex(mutex);
}