g+
g+ Communities
Argonne National Laboratory

Experimental Physics and
Industrial Control System

<20022003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  Index <20022003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014 
<== Date ==> <== Thread ==>

Subject: POSIX recursive mutex
From: Marty Kraimer <mrk@aps.anl.gov>
To: Jeff Hill <johill@lanl.gov>, "Johnson, Andrew N." <anj@aps.anl.gov>, core-talk@aps.anl.gov
Date: Mon, 02 Dec 2002 15:26:46 -0600
A problem using pthread_mutex to implement epicsMutex is that pthreads does not provide a pthread_mutex_lock with a timeout. Thus the only way I see to implement epicsMutexLockWithTimeout is to do something like

timeleft = timeout;
while(timeleft>0.0) {
    if(pthread_mutex_trylock(...)==success) break;
    epicsThreadSleep(shortTime);
    timeleft -= shortTime;
}

I am not bsure this is a good idea. What do you think?

Marty


Replies:
RE: POSIX recursive mutex Jeff Hill

Navigate by Date:
Prev: RE: 3.14 Gateway Performance Kenneth Evans, Jr.
Next: RE: POSIX recursive mutex Jeff Hill
Index: <20022003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014 
Navigate by Thread:
Prev: Re: R3.15 and dbd files Andrew Johnson
Next: RE: POSIX recursive mutex Jeff Hill
Index: <20022003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014 
ANJ, 02 Feb 2012 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICSv4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·