fix thread startup aftre restore.
This commit is contained in:
parent
05d3266671
commit
475face871
34
pl/qly.yap
34
pl/qly.yap
@ -156,6 +156,9 @@ save_program(File, _Goal) :-
|
||||
lists:member(F:V,L),
|
||||
catch(yap_flag(F,V),_,fail),
|
||||
fail.
|
||||
'$do_init_state' :-
|
||||
'$reinit_thread0',
|
||||
fail.
|
||||
'$do_init_state' :-
|
||||
set_value('$user_module',user),
|
||||
'$protect',
|
||||
@ -215,10 +218,17 @@ save_program(File, _Goal) :-
|
||||
'$init_from_saved_state_and_args'.
|
||||
|
||||
'$init_path_extensions' :-
|
||||
get_value('$extend_file_search_path',P), !,
|
||||
P \= [],
|
||||
set_value('$extend_file_search_path',[]),
|
||||
'$extend_file_search_path'(P).
|
||||
get_value('$extend_file_search_path',P), !,
|
||||
P \= [],
|
||||
set_value('$extend_file_search_path',[]),
|
||||
'$extend_file_search_path'(P).
|
||||
'$init_path_extensions' :-
|
||||
retractall(user:library_directory(_)),
|
||||
% make sure library_directory is open.
|
||||
\+ clause(user:library_directory(_),_),
|
||||
'$system_library_directories'(D),
|
||||
assert(user:library_directory(D)),
|
||||
fail.
|
||||
'$init_path_extensions'.
|
||||
|
||||
% then we can execute the programs.
|
||||
@ -276,6 +286,22 @@ save_program(File, _Goal) :-
|
||||
'$myddas_import_all'.
|
||||
|
||||
|
||||
qsave_file(File) :-
|
||||
recorded('$module', '$module'(F,Mod,Exps), _),
|
||||
'$fetch_parents_module'(Mod, Parents),
|
||||
'$fetch_imports_module'(Mod, Imps),
|
||||
'$fetch_multi_files_module'(Mod, MFs),
|
||||
'$fetch_meta_predicates_module'(Mod, Metas),
|
||||
'$fetch_module_transparents_module'(Mod, ModTransps),
|
||||
asserta(Mod:'@mod_info'(F, Exps, Parents, Imps, Metas, ModTransps)),
|
||||
atom_concat(Mod,'.qly',OF),
|
||||
open(OF, write, S, [type(binary)]),
|
||||
'$qsave_module_preds'(S, Mod),
|
||||
close(S),
|
||||
abolish(Mod:'@mod_info'/6),
|
||||
fail.
|
||||
qsave_file(_).
|
||||
|
||||
qsave_module(Mod) :-
|
||||
recorded('$module', '$module'(F,Mod,Exps), _),
|
||||
'$fetch_parents_module'(Mod, Parents),
|
||||
|
Reference in New Issue
Block a user