lkml.org 
[lkml]   [1999]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: mutex lock function pair?
Date
From
> When 1st thread call mutex lock, it acquired lock and process the followed
> code. If other threads try to acquire same lock before the lock is
> released, those threads are put into sleep. When 1st thread finished
> process and releases lock through mutex unlock, all other sleeping threads
> which are waiting for the lock are waken and try to acquire the lock.
> Whoever gets the lock can be processed and others go back to sleep again.
> Those mutex lock/unlock pair provide protection for critical pass.

The Linux semaphores provide mutex locking. The calls being

down(&sem)
up(&sem)

and also

down_interruptible(&sem)

which allows for signals to interrupt .. ie



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.038 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site