2015-09-07 11:44:36 -06:00
|
|
|
|
// concurrency/SerialNumberGenerator.java
|
2015-06-15 17:47:35 -07:00
|
|
|
|
// <20>2015 MindView LLC: see Copyright.txt
|
|
|
|
|
|
|
|
|
|
public class SerialNumberGenerator {
|
|
|
|
|
private static volatile int serialNumber = 0;
|
|
|
|
|
public static int nextSerialNumber() {
|
|
|
|
|
return serialNumber++; // Not thread-safe
|
|
|
|
|
}
|
2015-09-07 11:44:36 -06:00
|
|
|
|
}
|