File tree 1 file changed +17
-17
lines changed
assignments/week-3-assignment-2/src/edu/vuum/mocca 1 file changed +17
-17
lines changed Original file line number Diff line number Diff line change 13
13
* "NonFair" semaphore semantics, just liked Java Semaphores.
14
14
*/
15
15
public class SimpleSemaphore {
16
+ /**
17
+ * Define a ReentrantLock to protect the critical section.
18
+ */
19
+ // TODO - you fill in here
20
+
21
+ /**
22
+ * Define a ConditionObject to wait while the number of
23
+ * permits is 0.
24
+ */
25
+ // TODO - you fill in here
26
+
27
+ /**
28
+ * Define a count of the number of available permits.
29
+ */
30
+ // TODO - you fill in here. Make sure that this data member will
31
+ // ensure its values aren't cached by multiple Threads..
32
+
16
33
/**
17
34
* Constructor initialize the data members.
18
35
*/
@@ -52,22 +69,5 @@ public int availablePermits(){
52
69
// TODO - you fill in here
53
70
return 0 ; // You will change this value.
54
71
}
55
-
56
- /**
57
- * Define a ReentrantLock to protect the critical section.
58
- */
59
- // TODO - you fill in here
60
-
61
- /**
62
- * Define a ConditionObject to wait while the number of
63
- * permits is 0.
64
- */
65
- // TODO - you fill in here
66
-
67
- /**
68
- * Define a count of the number of available permits.
69
- */
70
- // TODO - you fill in here. Make sure that this data member will
71
- // ensure its values aren't cached by multiple Threads..
72
72
}
73
73
You can’t perform that action at this time.
0 commit comments