Synchronized work with timeout.