I know that we can use pthread_mutex_init and pthread_mutex_lock to implement thread mutual exclusion. But how can I implement it in kernel module with kthread?
I know that we can use pthread_mutex_init and pthread_mutex_lock to implement thread mutual exclusion.
Share
You cannot use the
pthread_mutex_*functions as these are userspace-only calls. In the kernel use the use the mutexes provided by linux/mutex.h: