From d94e5881f4653b1756fdbf8513973022962215e4 Mon Sep 17 00:00:00 2001 From: heck Date: Sat, 27 Mar 2021 05:16:56 +0100 Subject: [PATCH] PYADPT-111: sync_handshake.py, now support single- and mutlithreaded again. but through libpEpAdapter --- test/sync_handshake.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/test/sync_handshake.py b/test/sync_handshake.py index b75ef49..e92ffe5 100755 --- a/test/sync_handshake.py +++ b/test/sync_handshake.py @@ -186,16 +186,11 @@ def run(name, color=None, imap=False, own_ident=1, leave=False): pEp.message_to_send = messageToSend if multithreaded: - from threading import Thread - def sync_thread(): - print(colored("********* ", "yellow") + colored("sync_thread entered", color)) - print(colored("********* ", "yellow") + colored("UserInterface object created", color)) - pEp.Sync.run() - print(colored("********* ", "yellow") + colored("leaving sync_thread", color)) - sync = Thread(target=sync_thread) - sync.start() + print("Sync Start multi-threaded") + pEp.set_sync_mode(pEp.SyncModes.Async) else: - pEp.start_sync(); + print("Sync Start single-threaded") + pEp.set_sync_mode(pEp.SyncModes.Sync); try: if leave: