Merge pull request #689 from dadav/fix/bt-tether-lock
Add lock to bt-tether
This commit is contained in:
commit
4f153e3899
@ -2,6 +2,7 @@ import logging
|
|||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
|
from threading import Lock
|
||||||
|
|
||||||
import dbus
|
import dbus
|
||||||
|
|
||||||
@ -426,6 +427,7 @@ class BTTether(plugins.Plugin):
|
|||||||
self.ready = False
|
self.ready = False
|
||||||
self.options = dict()
|
self.options = dict()
|
||||||
self.devices = dict()
|
self.devices = dict()
|
||||||
|
self.lock = Lock()
|
||||||
|
|
||||||
def on_loaded(self):
|
def on_loaded(self):
|
||||||
# new config
|
# new config
|
||||||
@ -479,6 +481,7 @@ class BTTether(plugins.Plugin):
|
|||||||
if not self.ready:
|
if not self.ready:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
with self.lock:
|
||||||
devices_to_try = list()
|
devices_to_try = list()
|
||||||
connected_priorities = list()
|
connected_priorities = list()
|
||||||
any_device_connected = False # if this is true, last status on screen should be C
|
any_device_connected = False # if this is true, last status on screen should be C
|
||||||
|
Loading…
x
Reference in New Issue
Block a user