[vlc-devel] Re: vlc_thread_create & arguments
Remi Denis-Courmont
rdenis at simphalempin.com
Thu Jun 15 12:46:05 CEST 2006
Selon Karen <debugvlc at yahoo.com>:
> But as far as I see it does not accept arguments that should be
> passed to a function (like in pthread_create()).
Yes, it is not as straight forward with the weird VLC coding patterns.
> How can I pass arguments to a function when I create a thread with
> vlc_thread_create?
You have pass a vlc_object_t pointer to vlc_thread_create(). This pointer is
then passed to the thread entry point. To pass custom data, you will
typically use the p_sys member from the vlc_object_t.
It implies that you actually "own" the vlc_object_t, as modifying someone
else's object p_sys pointer is more than likely to cause a crash.
--
Remi Denis-Courmont
http://www.simphalempin.com/home/
--
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
More information about the vlc-devel
mailing list