ProConUnprotected: Initial commit
This commit is contained in:
15
Technology/ProConUnprotected/src/UnsynchronizedBuffer.java
Normal file
15
Technology/ProConUnprotected/src/UnsynchronizedBuffer.java
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
public class UnsynchronizedBuffer implements Buffer {
|
||||
private int buffer = -1;
|
||||
|
||||
public void set( int value ) {
|
||||
System.err.println( Thread.currentThread().getName() + " writes " + value);
|
||||
buffer = value;
|
||||
}
|
||||
|
||||
public int get() {
|
||||
System.err.println( Thread.currentThread().getName() + " reads " + buffer);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user