[vlc-devel] [RFC v2 1/2] executor: introduce new executor API
Romain Vimont
rom1v at videolabs.io
Wed Sep 2 11:24:32 CEST 2020
On Wed, Sep 02, 2020 at 10:34:28AM +0200, Romain Vimont wrote:
> On Wed, Sep 02, 2020 at 08:13:15AM +0200, Steve Lhomme wrote:
> > On 2020-09-01 18:13, Romain Vimont wrote:
> > > + *
> > > + * \param userdata the userdata provided to vlc_executor_Submit()
> > > + */
> > > + void (*run)(void *userdata);
> >
> > Since the userdata is also part of the vlc_runnable, you may pass the
> > vlc_runnable instead of the userdata. It allows more flexibilty in the
> > future (for example if you want to do actions on the runnable, like run it
> > again).
>
> Good point. But now I realize that running a runnable again may cause
> issues in regards to cancelation/deletion.
In fact, my preference is to pass "userdata" directly (not the
vlc_runnable instance), because this is typically what the user directly
need.
In case the very same runnable must be resubmitted (I would recommend
against it, and create a new runnable instead, otherwise it may be more
difficult to handle cancelation correctly), the runnable instance is
typically accessible from the user-provided structure hidden behind the
void*.
More information about the vlc-devel
mailing list