JVM Languages
xsync.txt
Associated article: Mutual Exclusion and Synchronization in Java
Tags: JVM Languages
Published source code accompanying the article by Dan Ford in which he discusses Java's concurrency features, presenting classes for mutual exclusion and synchronization that mimic the behavior and interfaces of the synchronization mechanisms available in the Win32 API.
Mutual Exclusion and Synchronization in Java
by Dan Ford
Listing One
import java.util.Date;
class MyThread extends Thread {
public void run() {
while (true) {
System.out.println("It is now " + new Date());
try {
Thread.sleep(1000); // sleep for 1 second
} ...


