Merge pull request #689 from dadav/fix/bt-tether-lock

Add lock to bt-tether
This commit is contained in:
evilsocket 2019-12-06 15:01:29 +02:00 committed by GitHub
commit 4f153e3899
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,7 @@ import logging
import os
import subprocess
import time
from threading import Lock
import dbus
@ -426,6 +427,7 @@ class BTTether(plugins.Plugin):
self.ready = False
self.options = dict()
self.devices = dict()
self.lock = Lock()
def on_loaded(self):
# new config
@ -479,6 +481,7 @@ class BTTether(plugins.Plugin):
if not self.ready:
return
with self.lock:
devices_to_try = list()
connected_priorities = list()
any_device_connected = False # if this is true, last status on screen should be C