I suggest you ...

Add support for pthread_mutex_trylock() semantics

As described in http://www.gimpel.com/Discussion.cfm?ThreadID=3793 this functionality is needed.

For example, this function results in lint warning 455 (A thread mutex that had not been locked is being unlocked):

bool IsLocked()
{
int retStat = pthread_mutex_trylock(&m_pthreadMutex);
if (retStat == 0)
{
// Mutex was not locked, but is now.
pthread_mutex_unlock(&m_pthreadMutex);
return (false);
}
else if (retStat == EBUSY)
{
// Mutex is already locked.
return (true);
}
return (false);
}

17 votes
Vote
Sign in
(thinking…)
Sign in with: Facebook Google
Signed in as (Sign out)
You have left! (?) (thinking…)
Kurt shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

0 comments

Sign in
(thinking…)
Sign in with: Facebook Google
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base