While one thread can dequeue frames from mapped buffers, other thread can Close() device and free buffers.
Mutex name also changed to correspond its new role.
Denis find some problem with my proposed patch so i think we must postone this bug resolution till better solution will be found.
Preventing possible crash during closing state
New patch was checked by Denis and get a green light from him.
Even if it works fine for me and Denis i asking Robert to see if it was correctly implemented.
I am just not sure i've done everything right.
Main idea of this patch is to create PVideoInputDevice_V4L2 object with locked readyToReadMutex (from the time of creation) and unlock it during Start(). Stop() locking this mutex again.
Also same mutex lock with PWaitAndSignal object GetFrameDataNoDelay(). Is it ok to use mixed locking with Wait()/Signal() and PWaitAndSignal?
Fix applied to Eridani (PTLib 2.12, OPAL 3.12) and trunk, thank you very much!
Log in to post a comment.