Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux Kernel mutex_lock_interruptible

Tags:

linux-kernel

The mutex_lock_interruptible() function in the linux kernel basically tries to lock a mutex and will continue waiting until a task is interrupted. Well how do I actually interrupt a task?

like image 634
Caleb Merchant Avatar asked Jul 10 '16 23:07

Caleb Merchant


1 Answers

Suffix _interruptible in Linux kernel means that waiting by the function will be interrupted if thread(process) receives the signal.

It can be signal sent by kill() user-space function, or signals generated by specific functions when condition met, e.g. by the timer (create_timer() when time is expired, or by asinchronous IO when pending operation has been completed.

Note, that uninterruptible wait cannot be interrupted even by SIGKILL, that is process cannot be finished until such wait ends.

like image 143
Tsyvarev Avatar answered Oct 07 '22 01:10

Tsyvarev