[Live-devel] Proper function calls from other threads (was: RE: All client termination)
Ross Finlayson
finlayson at live555.com
Wed Sep 12 11:50:56 PDT 2012
> In the example below, SeekAbsolute() will execute on a second thread, assigning scs.seekToAbsolutePosition
[...]
> void SeekAbsolute(OurRTSPClient *rtspClient, char *seekTo)
> {
> if (rtspClient)
> {
> // Pass on the argument.
> StreamClientState& scs = ((OurRTSPClient*)rtspClient)->scs;
> strcpy_s(scs.seekToAbsolutePosition, sizeof(scs.seekToAbsolutePosition), seekTo);
>
> UsageEnvironment& env = rtspClient->envir();
> env.taskScheduler().triggerEvent(mySeekAbsoluteEvent, rtspClient);
> }
> }
Yes, this looks fine (provided, of course that nothing in the LIVE555 event loop thread also modifies "scs.seekToAbsolutePosition", or can delete "rtspClient" while "SeekAbsolute()" is being called).
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120912/2009c79e/attachment.html>
More information about the live-devel
mailing list