lkml.org 
[lkml]   [1999]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject(2.0.36) safe way to test semaphore
Hello,
I'm updating a device driver written for 2.0.36, and was wondering about a
safe way to test semaphore (kernel semaphore, not SYSV shared memory,
which also contains semaphores).

Basically my problem is :
process A is called, and do a down(&sem). After a second call to process
A, the semaphore will be released.
process B is called when semaphore is down (it access the same data
structures as process A). It should not wait for the semaphore to be released,
but should deliver immediatly an error message. In process B, how could I
detect is the semaphore is currently "hold" by some other process ?

Thanks in advance

Pascal A. Dupuis

--
linux : un noyau
windows : des pépins


-
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:50    [W:0.033 / U:0.680 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site