ruby: thread synchronize implement in rails/spring