Skip to content

Commit

Permalink
'join' is what we have to use to wait for threads
Browse files Browse the repository at this point in the history
(this has been broken for years)
  • Loading branch information
totaam committed Oct 24, 2022
1 parent d1b0c8c commit 54775f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions xpra/server/background_worker.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# This file is part of Xpra.
# Copyright (C) 2013, 2014 Antoine Martin <antoine@xpra.org>
# Copyright (C) 2013-2022 Antoine Martin <antoine@xpra.org>
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any
# later version. See the file COPYING for details.

Expand Down Expand Up @@ -28,7 +28,7 @@ def __init__(self):
self.daemon_work_items = WeakSet()

def __repr__(self):
return "Worker_Thread(items=%s, exit=%s)" % (self.items.qsize(), self.exit)
return f"Worker_Thread(items={self.items.qsize()}, exit={self.exit})"

def stop(self, force=False):
if self.exit:
Expand Down
2 changes: 1 addition & 1 deletion xpra/server/server_core.py
Expand Up @@ -340,7 +340,7 @@ def quit_timer():
if w and w.is_alive():
#wait up to 1 second for the worker thread to exit
try:
w.wait(1)
w.join(1)
except Exception:
pass
if w.is_alive():
Expand Down

0 comments on commit 54775f1

Please sign in to comment.