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 aThe 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:
from threading import Locklock = Lock()Code:
with lock: ... code here ...Statistics: Posted by therealdavidp — Fri Oct 25, 2024 12:27 pm