[PATCH] qcap: Fix always wait for ReadThread to end when fiter_Stop.

Zebediah Figura z.figura12 at gmail.com
Mon Jun 29 10:28:21 CDT 2020


On 6/29/20 1:31 AM, Jiajin Cui wrote:
> Hello Zebediah,
>   I read your modifications and tested accordingly, and found that there was a small problem: After ReadThead() called EnterCriticalSection(), it caused other threads to wait for the critical section object when calling v4l_device_start_stream()/v4l_device_stop_stream()/v4l_device_cleanup_stream() function.
>   You can use graphedit.exe to test. When the fiter is connected, the program will freeze after clicking the play/pause/stop button.
>   I think need to modify the positionof that calls EnterCriticalSection () and LeaveCriticalSection() in the ReadThread () function. what do you think?

Thanks, I've sent a new version that should fix that deadlock.

> 
>> On 6/28/20 1:07 AM, Jiajin Cui wrote:
>>> There is a very small probability that the ReadThread will always wait for run_event signal after filet_Stop calls qcap_driver_stop_stream, and then filter_Stop is stuck waiting for the ReadThread to exit when calling qcap_driver_cleanup_stream. This issue was found in the video call hang up of Tencent QQ application.
>>>
>>> Signed-off-by: Jiajin Cui <cuijiajin at uniontech.com>
>>> ---
>>>  dlls/qcap/v4l.c | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>
>> While this certainly works, I don't particularly like the code
>> organization (it's kind of existentially weird that cleanup_stream()
>> sets "run_event".) After playing with this for a while I came up with a
>> different solution that uses a condition variable, and should also fix
>> this hang. I've sent that to the mailing list; please let me know
>> whether it fixes your problem.
>>
>>
>>
>>
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20200629/1eaa7794/attachment.sig>


More information about the wine-devel mailing list