File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -841,15 +841,17 @@ public class InMemoryFileSystem: FileSystem {
841841 }
842842
843843 public func withLock< T> ( on path: AbsolutePath , type: FileLock . LockType = . exclusive, _ body: ( ) throws -> T ) throws -> T {
844- let resolvedPath : AbsolutePath
844+ let fileQueue : DispatchQueue = try lockFilesLock . withLock {
845845
846- if case let . symlink( destination) = try getNode ( path) ? . contents {
847- resolvedPath = AbsolutePath ( destination, relativeTo: path. parentDirectory)
848- } else {
849- resolvedPath = path
850- }
846+ let resolvedPath : AbsolutePath
847+
848+ // FIXME: resolving symlinks is not yet thread safe
849+ if case let . symlink( destination) = try getNode ( path) ? . contents {
850+ resolvedPath = AbsolutePath ( destination, relativeTo: path. parentDirectory)
851+ } else {
852+ resolvedPath = path
853+ }
851854
852- let fileQueue : DispatchQueue = lockFilesLock. withLock {
853855 if let queueReference = lockFiles [ resolvedPath] , let queue = queueReference. reference {
854856 return queue
855857 } else {
You can’t perform that action at this time.
0 commit comments