<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Sep 17, 2014 at 2:58 PM, Ludovic Rousseau <span dir="ltr"><<a href="mailto:ludovic.rousseau@gmail.com" target="_blank">ludovic.rousseau@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">>> > If A dies then the lock will be released automatically. If that does<br>
>> > not occur then it is a bug in pcsc-lite and you should report it.<br>
><br>
> What locking system are you using? Flock? Mutex?<br>
> Can you link any source where using it? I'm very interested in this!<br>
<br>
</span>MSGCleanupClient() (from winscard_svc.c [1]) is called when the client<br>
application closes (intentionally or not) the socket communication<br>
with pcscd.<br>
MSGCleanupClient() then does the cleanup (calls SCardReleaseContext).<br>
<br>
Bye<br>
<br>
[1] <a href="http://anonscm.debian.org/viewvc/pcsclite/trunk/PCSC/src/winscard_svc.c?view=markup" target="_blank">http://anonscm.debian.org/viewvc/pcsclite/trunk/PCSC/src/winscard_svc.c?view=markup</a> line 968<br></blockquote><br></div>This question comes to light due the problems we had in the past with our globally-shared mutex.<br></div><div class="gmail_extra">In our case we have several applications invoking a library (not a service) which had to manage concurrency.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">In the beggining we used pthread_mutex, but as OSX 10.6 didnt support pthread_mutexattr_setpshared, pthread_mutexattr_setrobust, pthread_mutex_consistent, we ended using systemV semaphores.<br></div><div class="gmail_extra">In windows we used named semaphores and in linux pthread_mutex_consistent when abandoned<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Thx for the link! ;)<br></div></div>