mutex lock function pair?

WANG,YIDING (yiding_wang@am.exch.hp.com)
Thu, 9 Sep 1999 16:53:28 -0600


Does Linux kernel have mutex lock/unlock function pair as LOCK/UNLOCK in
UnixWare and mutex_enter/mutex_exit in Solaris?

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.

I was trying to use set_bit(test_and_set_bit)/cleear_bit for the mission but
they don't do the job. Hope someone can help to point out such utility pair
in Linux!

Many thanks!

-eddie


-
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/