Home Man
Today's Posts

Linux & Unix Commands - Search Man Pages

NetBSD 6.1.5 - man page for _lwp_park (netbsd section 2)

_LWP_PARK(2)			     BSD System Calls Manual			     _LWP_PARK(2)

     _lwp_park -- wait interruptably in the kernel

     Standard C Library (libc, -lc)

     #include <lwp.h>

     _lwp_park(const struct timespec *abstime, lwpid_t unpark, const void *hint,
	 const void *unparkhint);

     _lwp_park() can be used to synchronize access to resources among multiple light-weight pro-
     cesses.  It causes the calling LWP to wait interruptably in the kernel, until one of the
     following conditions is met:

     o	 The abstime argument is non-NULL, and the absolute UTC time it specifies has passed.

     o	 The LWP receives a directed signal posted using _lwp_kill(), or is elected to handle a
	 signal on behalf of its containing process.

     o	 The LWP is awoken by another LWP in the same process that has made a call to

     o	 The LWP is awoken by another LWP in the same process that has made a call to
	 _lwp_unpark() or _lwp_unpark_all().

     The preferred method to awaken an LWP sleeping as a result of a call to _lwp_park() is to
     make a call to _lwp_unpark(), or _lwp_unpark_all().  The _lwp_wakeup() system call is a more
     general facility, and requires more resources to execute.

     The optional hint argument specifies the address of object upon which the LWP is synchroniz-
     ing.  When the hint value is matched between calls to _lwp_park() and _lwp_unpark() or
     _lwp_unpark_all(), it may reduce the time necessary for the system to resume execution of
     waiting LWPs.

     The unpark and unparkhint arguments can be used to fold a park operation and unpark opera-
     tion into a single system call.  If unpark is non-zero, the system will behave as if the
     following call had been made before the calling thread begins to wait:

	     _lwp_unpark(unpark, unparkhint);

     _lwp_park() may return a value of 0.  Otherwise, -1 is returned and errno is set to provide
     more information.

	       A request was made to wake the LWP before it began to wait in the kernel.

     [EINTR]   The LWP has been awoken by a signal or by a call to one of the following func-
	       tions: _lwp_unpark(), _lwp_unpark_all(), _lwp_wakeup().

     [EINVAL]  The time value specified by abstime is invalid.

     [ESRCH]   No LWP can be found in the current process corresponding to unpark.

	       The UTC time specified by abstime has passed.

     _lwp_unpark(2), _lwp_unpark_all(2), _lwp_wakeup(2)

     The _lwp_park() system call first appeared in NetBSD 5.0.

BSD					September 25, 2007				      BSD

All times are GMT -4. The time now is 03:45 PM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
Show Password