I created a Semaphore
Semaphore semaphore = new Semaphore(1);
We have overloaded aquire methods like:
aquire()
aquire(int)
Q1 : For the current semaphore where there is only 1 permit, will the second method(aquire(int)) have any significance?
Q2: I am still a bit confused with
new Semaphore(int)
new Semaphore(int,true)
new Semaphore(int, false)
Q3: If I call release(), without calling aquire(), what happens to the number of permits, does that increase than what we have declared?
Note : There are multiple threads which share the Semaphore Object .
Appreciate any help.