Some semaphores are used as mutexes, in a protocol where the count can never exceed 1.
Some semaphores are squirrel-handed.
Other semaphores are initialized to greater than one. Obvious case of not-a-mutex.
Others are initialized to 1, or 0, or -1, or w/e, and can be treated as mutexes at first, but as soon as someone who doesn't hold the lock does a post, all bets are off. There's no worry to try to track exclusivity in the one-shot message-passing scenario, since happens before covers that.
Seems like this should be sufficient. But there is also the issue of ordering threads so that the bets-off-post comes later than some earlier analysis. If we don't retroactively redo that analysis to ignore that lock being held, there could be false negatives (data races missed).
Some semaphores are used as mutexes, in a protocol where the count can never exceed 1.
Some semaphores are squirrel-handed.
Other semaphores are initialized to greater than one. Obvious case of not-a-mutex.
Others are initialized to 1, or 0, or -1, or w/e, and can be treated as mutexes at first, but as soon as someone who doesn't hold the lock does a post, all bets are off. There's no worry to try to track exclusivity in the one-shot message-passing scenario, since happens before covers that.
Seems like this should be sufficient. But there is also the issue of ordering threads so that the bets-off-post comes later than some earlier analysis. If we don't retroactively redo that analysis to ignore that lock being held, there could be false negatives (data races missed).