Add explicit synchronization function to Java interface.