MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / try_lock_working_copy

Method try_lock_working_copy

atomic-repository/src/repository/locks.rs:379–394  ·  view source on GitHub ↗

Advance from the common lock to one working-copy lock without blocking.

(
        self,
        working_copy: WorkingCopyId,
    )

Source from the content-addressed store, hash-verified

377
378 /// Advance from the common lock to one working-copy lock without blocking.
379 pub(super) fn try_lock_working_copy(
380 self,
381 working_copy: WorkingCopyId,
382 ) -> Result<WorkingCopyOperationLockGuard, RepositoryError> {
383 let path = working_copy_operation_lock_path(&self.dot_dir, working_copy);
384 let working_copy_lock = try_lock_file(
385 &path,
386 RepositoryLockKind::WorkingCopy { id: working_copy },
387 self.reentrant,
388 )?;
389 Ok(WorkingCopyOperationLockGuard {
390 _working_copy_lock: working_copy_lock,
391 common: self,
392 working_copy,
393 })
394 }
395
396 /// A same-thread alias of this held common lock (CB-8B): the nested
397 /// projection executor builds its own working-copy guard under the

Calls 2

try_lock_fileFunction · 0.85