mutex_trylock

Makes a single attempt to acquire the specified mutex.

Library:LibC
Classification:UNIX International
Service:Synchronization

Syntax

  #include <synch.h>
   
  int  mutex_trylock  (
     mutex_t   *mp );
  

Parameters

mp

(IN) Points to the mutex to acquire.

Return Values

If successful in acquiring the mutex, returns 0; otherwise returns -1.

Remarks

If the lock being acquired is not available (is held by a different thread), mutex_trylock returns immediately.

See Also