no deadlock, but still not threadsafe