]> Repositorios git - scryer-prolog.git/commitdiff
fix deadlock in `load_library_as_stream`
authorSkgland <[email protected]>
Sun, 27 Aug 2023 17:56:55 +0000 (19:56 +0200)
committerBennet Bleßmann <[email protected]>
Tue, 5 Sep 2023 17:12:22 +0000 (19:12 +0200)
src/machine/system_calls.rs

index 47d203fd5d469d6f6b8625d3b869f830662e8bd6..7b017c175a96df65605cf372125def33ea2829e0 100644 (file)
@@ -7846,7 +7846,9 @@ impl Machine {
 
         use crate::machine::LIBRARIES;
 
-        match LIBRARIES.borrow().get(&*library_name.as_str()) {
+        let lib_ref = LIBRARIES.borrow();
+        let lib = lib_ref.get(&*library_name.as_str());
+        match lib {
             Some(library) => {
                 let lib_stream = Stream::from_static_string(library, &mut self.machine_st.arena);
                 unify!(