class CubbyHole { private int seq; // this is the condition variable. private boolean available = false; public native synchronized int get(); public native synchronized void put(int value); static { try { System.loadLibrary("threadex"); } catch (UnsatisfiedLinkError e) { System.err.println("can't find your library"); System.exit(-1); } } }