projects
/
org.ibex.util.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
d2efb65
)
added ability to count to Semaphore class
author
adam
<adam@megacz.com>
Fri, 3 Sep 2004 00:27:30 +0000
(
00:27
+0000)
committer
adam
<adam@megacz.com>
Fri, 3 Sep 2004 00:27:30 +0000
(
00:27
+0000)
darcs-hash:
20040903002730
-5007d-
1a8c33bb90720ccf2a955f27d432cb264fdd2273
.gz
src/org/ibex/util/Semaphore.java
patch
|
blob
|
history
diff --git
a/src/org/ibex/util/Semaphore.java
b/src/org/ibex/util/Semaphore.java
index
ad8376f
..
b37993c
100644
(file)
--- a/
src/org/ibex/util/Semaphore.java
+++ b/
src/org/ibex/util/Semaphore.java
@@
-12,9
+12,13
@@
public class Semaphore {
private int val = 0;
+ public synchronized void dec() {
+ val--;
+ }
+
/** Decrement the counter, blocking if zero. */
public synchronized void block() {
- while(val == 0) {
+ while(val <= 0) {
try {
wait();
} catch (InterruptedException e) {