Created
December 7, 2012 00:23
-
-
Save michealbenedict/4229665 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
static long foo = 0; | |
public static Lock lock = newLock(); | |
private static void increment() { | |
for(long l=0;l<1000000000L;l++) { | |
lock.lock(); | |
try { | |
foo++; | |
} finally { | |
lock.unlock(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment