Edward Hervey 605cb6a4d4 gstpad: Avoid race in (un)setting EOS flag on sinkpads
The scenario is the following:

* Thread 1 is pushing an EOS event on a sinkpad
* Thread 2 is pushing a STREAM_START event on the same sinkpad before Thread 1
returns. Note : It starts pushing the event after Thread 1 took the object lock.

There is a potential race between:

* The moment Thread 1 sets the EOS flag once it has finished sending the
event (via store_sticky_event). When it does that it has both the STREAM and
OBJECT lock

* The moment Thread 2 sends the STREAM_START event (Which should release that
EOS status), but removing the EOS flag is only done while holding the OBJECT
lock and not the STREAM_LOCK, which means it could be re-set by Thread 1 before
it then checks again the EOS flag (without the STREAM lock taken).

The EOS flag unsetting by STREAM_START should be done with the STREAM lock
taken, otherwise it will be racy.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1452

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3320>
2022-11-07 06:28:39 +01:00
..
2022-10-04 03:57:31 +01:00
2022-10-04 03:57:31 +01:00
2022-10-04 03:57:31 +01:00
2022-09-17 22:41:40 +00:00
2022-09-23 11:08:06 -04:00
2022-09-23 11:08:06 -04:00
2022-09-23 11:08:06 -04:00
2022-09-23 11:08:06 -04:00
2022-09-23 11:08:06 -04:00
2022-09-23 11:08:06 -04:00
2022-10-11 14:53:40 -04:00
2022-09-23 11:08:06 -04:00
2022-09-23 11:08:06 -04:00
2022-09-23 11:08:06 -04:00
2022-10-31 23:50:28 +00:00
2022-09-17 22:41:40 +00:00
2022-09-23 11:08:06 -04:00