[core] fix concurrency issues

* initialize first line of output earlier (before modules are
  initialized, so that module/thread output cannot interfere)
* make sure that update and draw are protected against concurrent access
This commit is contained in:
tobi-wan-kenobi 2022-09-04 16:22:29 +02:00
parent ee81f6198e
commit ee9885a601
3 changed files with 18 additions and 10 deletions

View file

@ -136,7 +136,6 @@ class Module(core.module.Module):
core.event.trigger("update", [self.id], redraw_only=True)
core.event.trigger("draw")
os.set_blocking(proc.stdout.fileno(), False)
time.sleep(0.5)
proc.stdout.read()
os.set_blocking(proc.stdout.fileno(), True)