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
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to firstname.lastname@example.org
Please read the FAQ at http://www.tux.org/lkml/