File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -2431,7 +2431,7 @@ Target::GetScratchTypeSystemForLanguage(lldb::LanguageType language,
2431
2431
// replacing it could cause a use-after-free later on.
2432
2432
auto &lock = GetSwiftScratchContextLock ();
2433
2433
if (lock.try_lock ()) {
2434
- auto unlock = llvm::make_scope_exit ([&lock] { lock. unlock (); } );
2434
+ std::lock_guard<std::shared_mutex> unlock (lock, std::adopt_lock );
2435
2435
if (m_use_scratch_typesystem_per_module)
2436
2436
DisplayFallbackSwiftContextErrors (swift_ast_ctx);
2437
2437
else if (StreamSP errs = GetDebugger ().GetAsyncErrorStream ()) {
@@ -2768,7 +2768,7 @@ llvm::Optional<SwiftScratchContextReader> Target::GetSwiftScratchContext(
2768
2768
log->Printf (" couldn't acquire scratch context lock\n " );
2769
2769
return ;
2770
2770
}
2771
- auto unlock = llvm::make_scope_exit ([&lock] { lock. unlock (); } );
2771
+ std::lock_guard<std::shared_mutex> unlock (lock, std::adopt_lock );
2772
2772
2773
2773
// With the lock held, get the current scratch type system. This ensures
2774
2774
// the current instance is used even in the unlikely event it was changed
You can’t perform that action at this time.
0 commit comments