<div dir="ltr">Well, you are the development branch maintainer, but for me a<div>code which fails only in 0.00001% of all cases is still incorrect. ;)</div><div><br></div><div>However, I also think that your idea to use a flag/counter in the wineserver</div><div>cannot really work. Lets assume the following code sequence:</div><div><br></div><div>* client starts the wineserver call, and calls pthread_setmask()</div><div>* server sends a SIGUSR1, because no outstading system APCs yet</div><div>* client writes the request</div><div>* server assumes that it is safe to dequeue the system APC now, only further USR1 signals are blocked</div><div>* client waits for the reply</div><div>* client restores signal mask, and receives the SIGUSR1 during the system APC</div><div><br></div><div>To fix that remaining race, you would have to check somehow, if the send SIGUSR1</div><div>has already arrived in the meantime. I think it only gets more ugly when going</div><div>in this direction. :/</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-11-04 14:49 GMT+01:00 Alexandre Julliard <span dir="ltr"><<a href="mailto:julliard@winehq.org" target="_blank">julliard@winehq.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sebastian Lackner <<a href="mailto:sebastian@fds-team.de">sebastian@fds-team.de</a>> writes:<br>
<br>
> I personally think its nice that USR1 signals do not crash the<br>
> application.<br>
> Other programs also use it for reloading the configuration, for<br>
> example.<br>
<br>
You say that it's so hard to trigger the race that you can't do it in a<br>
test program even trying a thousand times, but you are concerned that<br>
users will trigger it by accident, doing something that nobody ever<br>
does?  Come on...<br>
<br>
> If performance is a concern, we could also inline wine_server_call<br>
> here,<br>
> then the number of pthread_setmask calls would stay approximately<br>
> the same as before. Would that also be an option?<br>
<br>
It's quite ugly. It would need a convincing case that it can't be done<br>
any other way, and that it's affecting enough users to be worth it (with<br>
all due respect to Anastasius, it's not worth uglifying the code just<br>
for his specific use case).<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Alexandre Julliard<br>
<a href="mailto:julliard@winehq.org">julliard@winehq.org</a><br>
</font></span></blockquote></div><br></div>