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);
}

16 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Kurt shared this idea  ·   ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base