Created
February 2, 2012 00:54
-
-
Save rhsdev/1720539 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class AtomicLong { | |
| long value; | |
| public AtomicLong(long l) { | |
| value = l; | |
| } | |
| synchronized long addAndGet(long add) { | |
| value += add; | |
| return value; | |
| } | |
| public synchronized String toString() { | |
| return Long.toString(value); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment