code: func (fm *filesManager) lockFileIfOpened(file *file) bool {
  	return atomic.CompareAndSwapInt32(&file.state, fileOpened, fileInUse)
  }
docs: // lockFileIfOpened is like lockFile but returns true only if the
  // file is already opened, false otherwise (and the file remain closed).