Skip to content

Commit 58cd17d

Browse files
committed
[ORC] Add comments to ResourceManager to clarify locking rules.
1 parent 818bffc commit 58cd17d

File tree

1 file changed

+7
-0
lines changed
  • llvm/include/llvm/ExecutionEngine/Orc

1 file changed

+7
-0
lines changed

llvm/include/llvm/ExecutionEngine/Orc/Core.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,14 @@ class ResourceTracker : public ThreadSafeRefCountedBase<ResourceTracker> {
125125
class ResourceManager {
126126
public:
127127
virtual ~ResourceManager();
128+
129+
/// This function will be called *outside* the session lock. ResourceManagers
130+
/// should perform book-keeping under the session lock, and any expensive
131+
/// cleanup outside the session lock.
128132
virtual Error handleRemoveResources(JITDylib &JD, ResourceKey K) = 0;
133+
134+
/// This function will be called *inside* the session lock. ResourceManagers
135+
/// DO NOT need to re-lock the session.
129136
virtual void handleTransferResources(JITDylib &JD, ResourceKey DstK,
130137
ResourceKey SrcK) = 0;
131138
};

0 commit comments

Comments
 (0)