What is the equivalent of pthread_mutex_lock and pthread_cond_wait in the linux kernel. and how to use them. Could you please provide simple (hello world) examples.
What is the equivalent of pthread_mutex_lock and pthread_cond_wait in the linux kernel. and how
Share
mutex_lock()andmutex_unlock()and we should init the mutex before we use it withmutex_init()(from#include <linux/mutex.h>)pthread_cond_waitwait_event_interruptible()andwake_up_interruptible()and we should init the wait_queue_head withinit_waitqueue_head()(from#include <linux/wait.h>)