gst-plugins-rs/generic/threadshare/src
François Laignel a45f944edd ts/async_wrapper: remove fd from reactor before dropping its handle
The I/O handle was dropped prior to removing it from the reactor,
which caused `Poller::delete` to fail due to an invalid file
descriptor. This used to happen silently unless the same fd was
added again, e.g. by changing states in the pipeline as follow:

    Null -> Playing -> Null -> Playing.

In which case `Poller::add` failed due to an already existing file.

This commit makes sure the fd is removed from the reactor prior to
dropping the handle. In order to achieve this, a new task is spawned
on the `Context` on which the I/O was originally registered, allowing
it to access the proper `Reactor`. The I/O can then safely be dropped.

Because the I/O handle is moved to the spawned future, this solution
requires adding the `Send + 'static` bounds to the I/O handle used
within the `Async` wrapper. This appears not too restrictive for
existing implementations though. Other attempts were considered,
but they would cause deadlocks.

This new approach also solves a potential race condition where a
fd could be re-registered in a `Reactor` before it was removed.
2022-06-30 11:13:39 +00:00
..
appsrc Remove now unnecessary Send+Sync impls for element/etc subclasses 2022-02-28 18:56:58 +02:00
inputselector Remove now unnecessary Send+Sync impls for element/etc subclasses 2022-02-28 18:56:58 +02:00
jitterbuffer ts-jitterbuffer: set jbuf delay when instantiating it 2022-05-11 06:29:22 +00:00
proxy Remove now unnecessary Send+Sync impls for element/etc subclasses 2022-02-28 18:56:58 +02:00
queue Remove now unnecessary Send+Sync impls for element/etc subclasses 2022-02-28 18:56:58 +02:00
runtime ts/async_wrapper: remove fd from reactor before dropping its handle 2022-06-30 11:13:39 +00:00
tcpclientsrc Remove now unnecessary Send+Sync impls for element/etc subclasses 2022-02-28 18:56:58 +02:00
udpsink Fix a couple of new 1.62 clippy warnings 2022-06-28 14:52:20 +03:00
udpsrc Remove now unnecessary Send+Sync impls for element/etc subclasses 2022-02-28 18:56:58 +02:00
dataqueue.rs Update to gst::_log_macro_ 2022-02-21 20:50:01 +01:00
lib.rs Ignore clippy::non_send_fields_in_send_ty lint 2022-01-14 12:09:57 +02:00
socket.rs Update to gst::_log_macro_ 2022-02-21 20:50:01 +01:00