================
@@ -204,6 +237,35 @@ class DependencyScanningFilesystemSharedCache {
     getOrInsertEntryForFilename(StringRef Filename,
                                 const CachedFileSystemEntry &Entry);
 
+    /// Claims a slot for \p Filename. If a resolved entry already exists,
+    /// returns it. If another worker is currently producing a result for this
+    /// filename, blocks on its \c InProgressEntry until done and returns the
+    /// produced entry. Otherwise installs a fresh \c InProgressEntry and
+    /// returns it as a producer slot which the caller must complete via
+    /// \c fulfilFilenameSlot.
+    SlotAcquisitionResult acquireFilenameSlot(StringRef);
+
+    /// Claims a slot for \p UID. Same semantics as \c acquireFilenameSlot but
+    /// keyed by unique ID; used after \c stat() has identified a file so that
+    /// concurrent \c readFile() calls for the same on-disk file (reached via
+    /// different filenames) collapse onto a single open.
+    SlotAcquisitionResult acquireUIDSlot(llvm::sys::fs::UniqueID);
+
+    /// Completes a producer slot acquired via \c acquireFilenameSlot.
+    /// Publishes \p Result under \p Filename in \c CacheByFilename,
+    /// records it in the slot, marks the slot done, removes the
+    /// in-progress entry, and notifies waiters.
+    void fulfilFilenameSlot(StringRef, const std::shared_ptr<InProgressEntry> 
&,
----------------
artemcm wrote:

Fine, American spelling it is. 😉 

https://github.com/llvm/llvm-project/pull/199680
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to