<html><head><base href="x-msg://1162/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div ocsi="x"><div dir="ltr"><font color="#000000" size="2" face="Tahoma">thank you for your answer and the modification of the triggerEvent<span class="Apple-converted-space"> </span><br>function. Unfortunately I am not completely convinced whether this<span class="Apple-converted-space"> </span><br>will cure all race conditions which are imaginable for the application<span class="Apple-converted-space"> </span><br>of the trigger method in a multithreading environment.</font></div></div></span></blockquote><div><br></div>I believe it's now OK, as long as the statement</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> fTriggersAwaitingHandling |= eventTriggerId;</div><div>in the implementation of "triggerEvent()" is implemented as an atomic operation.</div><div><br></div><div><br></div><div><blockquote type="cite"><div ocsi="x"><div dir="ltr"><font color="#000000" size="2" face="Tahoma">One additional point which I would recommend you to change is the<span class="Apple-converted-space"> </span><br>implementation of the DeviceSource sample. Currently it uses a static<span class="Apple-converted-space"> </span><br>member variable for the eventTriggerId. The intention was of course that<span class="Apple-converted-space"> </span><br>all media sources which will be implemented by using that sample share ONE<span class="Apple-converted-space"> </span><br>eventTriggerId for all instances of the same class.</font></div></div></blockquote><div><br></div><div>"eventTriggerId" was made a static member variable of the "DeviceSource" class because this code was intended as an illustration of how to encapsulate a *single* device - not a set of devices. But yes, it could have been a non-static member variable instead. (And in your environment - where are using multiple device threads - you *must* do this, because "triggerEvent()" must not be called with the same 'event trigger id' from different threads.)</div></div><div><br></div><div>I have update the comments in "DeviceSource.hh" and "DeviceSource.cpp" - to appear in the next release of the software - to make this clearer.</div><br><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">Ross Finlayson<br>Live Networks, Inc.<br><a href="http://www.live555.com/">http://www.live555.com/</a></span></span>
</div>
<br></body></html>