Menu

#202 vos_mutexTrylock return value

1.4.0.0
closed
None
2018-06-25
2018-06-05
No

In current code, the return value of vos_mutexTryLock() is VOS_MUTEX_ERR/TRDP_MUTEX_ERR either if the mutex is already locked (err == EBUSY) or if the underlying pthread_mutex_trylock() call fails for any other reason (err == EINVAL).

IMHO sometimes it could be important beeing able to distiguish between the two situations.
So I suggest to return different values.

Discussion

  • Bernd Löhr

    Bernd Löhr - 2018-06-25
    • status: open --> accepted
    • assigned_to: Bernd Löhr
     
  • Bernd Löhr

    Bernd Löhr - 2018-06-25

    In case the mutex cannot be taken, VOS_INUSE_ERR (-49) will be returned.

     
  • Bernd Löhr

    Bernd Löhr - 2018-06-25
    • status: accepted --> closed
     
  • Bernd Löhr

    Bernd Löhr - 2018-06-25

    VOS_INUSE_ERR will be returned, if mutex was not taken

     

Log in to post a comment.

MongoDB Logo MongoDB