Skip to content

Commit 6c69159

Browse files
committed
Add comments about lock
1 parent 2a36e34 commit 6c69159

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/controller/python/chip/ChipStack.py

+4
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ def __init__(self, persistentStoragePath: str, installDefaultLogHandler=True,
208208
bluetoothAdapter=None, enableServerInteractions=True):
209209
builtins.enableDebugMode = False
210210

211+
# TODO: Probably no longer necessary, see https://github.com/project-chip/connectedhomeip/issues/33321.
211212
self.networkLock = Lock()
212213
self.completeEvent = Event()
213214
self.commissioningCompleteEvent = Event()
@@ -348,6 +349,7 @@ def setLogFunct(self, logFunct):
348349
logFunct = 0
349350
if not isinstance(logFunct, _LogMessageFunct):
350351
logFunct = _LogMessageFunct(logFunct)
352+
# TODO: Lock probably no longer necessary, see https://github.com/project-chip/connectedhomeip/issues/33321.
351353
with self.networkLock:
352354
# NOTE: ChipStack must hold a reference to the CFUNCTYPE object while it is
353355
# set. Otherwise it may get garbage collected, and logging calls from the
@@ -390,6 +392,7 @@ def Call(self, callFunct, timeoutMs: int = None):
390392
# throw error if op in progress
391393
self.callbackRes = None
392394
self.completeEvent.clear()
395+
# TODO: Lock probably no longer necessary, see https://github.com/project-chip/connectedhomeip/issues/33321.
393396
with self.networkLock:
394397
res = self.PostTaskOnChipThread(callFunct).Wait(timeoutMs)
395398
self.completeEvent.set()
@@ -422,6 +425,7 @@ def CallAsyncWithCompleteCallback(self, callFunct):
422425
# throw error if op in progress
423426
self.callbackRes = None
424427
self.completeEvent.clear()
428+
# TODO: Lock probably no longer necessary, see https://github.com/project-chip/connectedhomeip/issues/33321.
425429
with self.networkLock:
426430
res = self.PostTaskOnChipThread(callFunct).Wait()
427431

0 commit comments

Comments
 (0)