Skip to content

Commit 96b1f88

Browse files
committed
[ORC] Remove redundant locking of session mutex, update method name.
JITDylib::removeTracker already runs with the session mutex locked (and must do so), so remove the redundant locking and add an 'IL_' ("inside lock") prefix to the method name.
1 parent 0fe82ea commit 96b1f88

File tree

2 files changed

+5
-6
lines changed
  • llvm

2 files changed

+5
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1297,7 +1297,7 @@ class JITDylib : public ThreadSafeRefCountedBase<JITDylib>,
12971297
JITDylib(ExecutionSession &ES, std::string Name);
12981298

12991299
std::pair<AsynchronousSymbolQuerySet, std::shared_ptr<SymbolDependenceMap>>
1300-
removeTracker(ResourceTracker &RT);
1300+
IL_removeTracker(ResourceTracker &RT);
13011301

13021302
void transferTracker(ResourceTracker &DstRT, ResourceTracker &SrcRT);
13031303

llvm/lib/ExecutionEngine/Orc/Core.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,7 @@ JITDylib::JITDylib(ExecutionSession &ES, std::string Name)
12661266

12671267
std::pair<JITDylib::AsynchronousSymbolQuerySet,
12681268
std::shared_ptr<SymbolDependenceMap>>
1269-
JITDylib::removeTracker(ResourceTracker &RT) {
1269+
JITDylib::IL_removeTracker(ResourceTracker &RT) {
12701270
// Note: Should be called under the session lock.
12711271
assert(State != Closed && "JD is defunct");
12721272

@@ -1305,9 +1305,7 @@ JITDylib::removeTracker(ResourceTracker &RT) {
13051305
SymbolsToFail.push_back(Sym);
13061306
}
13071307

1308-
AsynchronousSymbolQuerySet QueriesToFail;
1309-
auto Result = ES.runSessionLocked(
1310-
[&]() { return ES.IL_failSymbols(*this, std::move(SymbolsToFail)); });
1308+
auto Result = ES.IL_failSymbols(*this, std::move(SymbolsToFail));
13111309

13121310
// Removed symbols should be taken out of the table altogether.
13131311
for (auto &Sym : SymbolsToRemove) {
@@ -2198,7 +2196,8 @@ Error ExecutionSession::removeResourceTracker(ResourceTracker &RT) {
21982196
runSessionLocked([&] {
21992197
CurrentResourceManagers = ResourceManagers;
22002198
RT.makeDefunct();
2201-
std::tie(QueriesToFail, FailedSymbols) = RT.getJITDylib().removeTracker(RT);
2199+
std::tie(QueriesToFail, FailedSymbols) =
2200+
RT.getJITDylib().IL_removeTracker(RT);
22022201
});
22032202

22042203
Error Err = Error::success();

0 commit comments

Comments
 (0)