Fixed threading and add shutdown control for threads via sleep

This commit is contained in:
gnembon committed 2020-10-24 22:18:02 -03:00
1 parent e50298a306
commit 1268af4131
8 files changed
+162 -107

No files matched your search

@@ -458,6 +458,12 @@ show() ->
task( _() -> (
global_markers = __create_markers();
on_close = ( _() -> (
for(global_markers, modify(_,'remove'));
global_markers = null;
global_showing_path = false;
));
loop(7200,
if(!global_showing_path, break());
__get_player();
@@ -467,11 +473,9 @@ show() ->
global_markers = __create_markers();
);
__show_path_tick();
sleep(100);
sleep(100, on_close);
);
for(global_markers, modify(_,'remove'));
global_markers = null;
global_showing_path = false;
call(on_close);
));
null;
);
@@ -523,6 +527,7 @@ play() ->
modify(p, 'location', v);
point += 1;
end_time = time();
sleep();
if (global_prefer_sync,
should_be = very_start + mspt*point;
if (end_time < should_be, sleep(should_be-end_time) )