Skip to content

Commit 98cfa93

Browse files
Moved the data members to the beginning of the SimpleSemaphore class to be consistent with the other classes in other assignments.
1 parent 4fa339d commit 98cfa93

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

assignments/week-3-assignment-2/src/edu/vuum/mocca/SimpleSemaphore.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,23 @@
1313
* "NonFair" semaphore semantics, just liked Java Semaphores.
1414
*/
1515
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+
1633
/**
1734
* Constructor initialize the data members.
1835
*/
@@ -52,22 +69,5 @@ public int availablePermits(){
5269
// TODO - you fill in here
5370
return 0; // You will change this value.
5471
}
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..
7272
}
7373

0 commit comments

Comments
 (0)