Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8042

Camera board • Re: "Or Better"?

$
0
0
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:

Code:

from threading import Locklock = Lock()
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 a

Code:

with lock:    ... code here ...
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.

Statistics: Posted by therealdavidp — Fri Oct 25, 2024 12:27 pm



Viewing all articles
Browse latest Browse all 8042

Trending Articles