_lwp_mutex_trylock man page on SmartOS

Man page or keyword search:  
man Server   16655 pages
apropos Keyword Search (all sections)
Output format
SmartOS logo
[printable version]

_LWP_MUTEX_LOCK(2)					    _LWP_MUTEX_LOCK(2)

NAME
       _lwp_mutex_lock,	 _lwp_mutex_unlock, _lwp_mutex_trylock - mutual exclu‐
       sion

SYNOPSIS
       #include <sys/lwp.h>

       int _lwp_mutex_lock(lwp_mutex_t *mp);

       int _lwp_mutex_trylock(lwp_mutex_t *mp);

       int _lwp_mutex_unlock(lwp_mutex_t *mp);

DESCRIPTION
       These functions serialize the execution of lightweight processes.  They
       are useful for ensuring that only one lightweight process can execute a
       critical section of code	 at  any  one  time  (mutual  exclusion).  LWP
       mutexes must be initialized to 0 before use.

       The _lwp_mutex_lock() function locks the LWP mutex pointed to by mp. If
       the mutex is already locked, the calling LWP  blocks  until  the	 mutex
       becomes	available. When _lwp_mutex_lock() returns, the mutex is locked
       and the calling LWP is the "owner".

       The _lwp_mutex_trylock() function attempts to lock the  mutex.  If  the
       mutex  is  already  locked  it  returns	with an error. If the mutex is
       unlocked, it is locked and _lwp_mutex_trylock() returns.

       The _lwp_mutex_unlock() function unlocks a locked mutex. The mutex must
       be  locked  and	the  calling  LWP must be the one that last locked the
       mutex (the owner). If any other LWPs  are  waiting  for	the  mutex  to
       become available, one of them is unblocked.

RETURN VALUES
       Upon  successful	 completion, 0 is returned. A non-zero value indicates
       an error.

ERRORS
       If any of the following	conditions  are	 detected,  _lwp_mutex_lock(),
       _lwp_mutex_trylock(),  and _lwp_mutex_unlock() fail and return the cor‐
       responding value:

       EINVAL
		 The mp argument points to an invalid LWP mutex.

       EFAULT
		 The mp argument points to an illegal address.

       If any of the following conditions  occur,  _lwp_mutex_trylock()	 fails
       and returns the corresponding value:

       EBUSY
		The mp argument points to a locked mutex.

SEE ALSO
       Intro(2), _lwp_cond_wait(2)

				 Jul 30, 1992		    _LWP_MUTEX_LOCK(2)
[top]

List of man pages available for SmartOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net