Use synchronization methods from the JDK.