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

Method try_lock_working_copy

atomic-repository/src/repository/locks.rs:404–419  ·  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

402
403 /// Advance from the common lock to one working-copy lock without blocking.
404 pub(super) fn try_lock_working_copy(
405 self,
406 working_copy: WorkingCopyId,
407 ) -> Result<WorkingCopyOperationLockGuard, RepositoryError> {
408 let path = working_copy_operation_lock_path(&self.dot_dir, working_copy);
409 let working_copy_lock = try_lock_file(
410 &path,
411 RepositoryLockKind::WorkingCopy { id: working_copy },
412 self.reentrant,
413 )?;
414 Ok(WorkingCopyOperationLockGuard {
415 _working_copy_lock: working_copy_lock,
416 common: self,
417 working_copy,
418 })
419 }
420
421 /// A same-thread alias of this held common lock (CB-8B): the nested
422 /// projection executor builds its own working-copy guard under the

Calls 2

try_lock_fileFunction · 0.85