projects
/
IRC.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e68d517
)
Fix the thread safe problem
author
jzhou
<jzhou>
Thu, 3 May 2012 17:31:29 +0000
(17:31 +0000)
committer
jzhou
<jzhou>
Thu, 3 May 2012 17:31:29 +0000
(17:31 +0000)
Robust/src/ClassLibrary/MGC/gnu/Semaphore.java
patch
|
blob
|
history
diff --git
a/Robust/src/ClassLibrary/MGC/gnu/Semaphore.java
b/Robust/src/ClassLibrary/MGC/gnu/Semaphore.java
index 29d36d9a39b2d774e3ea7c4c0ff8396dc9bf65f9..365384933d879f08d12b5382ee1cf0e2bc0fc1d9 100644
(file)
--- a/
Robust/src/ClassLibrary/MGC/gnu/Semaphore.java
+++ b/
Robust/src/ClassLibrary/MGC/gnu/Semaphore.java
@@
-447,7
+447,7
@@
public class Semaphore implements /*java.io.*/Serializable {
* @throws InterruptedException if the current thread is interrupted
* @throws IllegalArgumentException if {@code permits} is negative
*/
* @throws InterruptedException if the current thread is interrupted
* @throws IllegalArgumentException if {@code permits} is negative
*/
- public void acquire(int permits) throws InterruptedException {
+ public
synchronized
void acquire(int permits) throws InterruptedException {
/*if (permits < 0) throw new IllegalArgumentException();
sync.acquireSharedInterruptibly(permits);*/
//System.out.println("Unimplemented Semaphore.acquire(int)!");
/*if (permits < 0) throw new IllegalArgumentException();
sync.acquireSharedInterruptibly(permits);*/
//System.out.println("Unimplemented Semaphore.acquire(int)!");
@@
-594,7
+594,7
@@
public class Semaphore implements /*java.io.*/Serializable {
* @param permits the number of permits to release
* @throws IllegalArgumentException if {@code permits} is negative
*/
* @param permits the number of permits to release
* @throws IllegalArgumentException if {@code permits} is negative
*/
- public void release(int permits) {
+ public
synchronized
void release(int permits) {
/*if (permits < 0) throw new IllegalArgumentException();
sync.releaseShared(permits);*/
//System.out.println("Unimplemented Semaphore.release()!");
/*if (permits < 0) throw new IllegalArgumentException();
sync.releaseShared(permits);*/
//System.out.println("Unimplemented Semaphore.release()!");