implementation that just uses synchronized