If you take the RLock here and the Lock further down, doesn't that deadlock `flushMemory()` forever? Or are these locks reentrant within the same goroutine?