That's like saying every integer has 2 states, zero and nonzero. I'm talking states in the computer science sense, not in the "what I prefer to look at" sense. These have 2^n states, whether you choose to care about them or not.
Just because Java calls it something that doesn't mean it is "typically" called that thing.
> Representing it as a "state machine" it would still have only 2 states. Open and closed.
No. There are lots of "open" states with different counter values. That you choose to call them all "open" and not observe the differences doesn't change this. It sounds like you've never studied state machines, so I recommend reading up on them; here's a starting point: https://en.wikipedia.org/wiki/State_(computer_science)#Finit...
> It's only been there since 2004 and is named the same in C#
No it's not... where did you get this? C# has CountdownEvent and Barrier. It's not called "latch".
Please avoid swipes in your comments like "It sounds like you've never studied state machines", "where did you get this?" and "There's no point continuing this argument so let's just leave it here". They invariably land with much more force on the other person than you intend, and this leads to much worse threads. It's easy to understand see how this post would turn into a provocation.
Ouch, please don't cross into personal attack, regardless of how annoying another comment is or you feel it is! We ban accounts that do that. Fortunately your comment history looks like a good one otherwise. If you wouldn't mind reviewing https://news.ycombinator.com/newsguidelines.html and sticking to the rules when posting here, we'd be grateful.
latches can be edge or level triggered. The important concept is that once they are triggered, they latch the input value, and maintain it after the input has disappeared.
The thing is, pretty much every object you work with in your programming language latches the most recently stored value in it. The machine is built on latching as a fundamental block.
A simple mutex latches open when you unlock it, and then latches locked when something locks it again.