Would you please be so kind as to add the additional "with lock:" code in location(s) you believe it would solve the issue? I genuinely have no clue as to where to put this code.Obviously I would recommend learning something about threads and locks in Python. But to summarise what you might want to try, near the top of your file you'll need this kind of thing:and then I would put, as a minimum, the code that releases cam2_request in save_request, and the code in mergeviews that takes cam2_request and acquires it, into aCode:
from threading import Locklock = Lock()The suspicion is that mergeviews is copying the reference to cam2_request, then save_request runs and releases it, and then mergeviews tries to acquire it, which would provoke exactly the error you are seeing. But (disclaimer...) there may be other problems, and I haven't tried your code.Code:
with lock: ... code here ...
Statistics: Posted by MRV — Fri Oct 25, 2024 12:39 pm