diff options
54 files changed, 8031 insertions, 0 deletions
diff --git a/manual/ChangeLog b/manual/ChangeLog new file mode 100644 index 0000000..f30e19a --- /dev/null +++ b/manual/ChangeLog @@ -0,0 +1,55 @@ +2005-05-06 Ross Johnson <ross at callisto.canberra.edu.au> + + * index.html: New. + * nonPortableIssues.html: New. + * pthread_attr_init.html: New. + * pthread_attr_setstackaddr.html: New. + * pthread_attr_setstacksize.html: New. + * pthread_barrierattr_init.html: New. + * pthread_barrierattr_setpshared.html: New. + * pthread_barrier_init.html: New. + * pthread_barrier_wait.html: New. + * pthreadCancelableWait.html: New. + * pthread_cancel.html: New. + * pthread_cleanup_push.html: New. + * pthread_condattr_init.html: New. + * pthread_condattr_setpshared.html: New. + * pthread_cond_init.html: New. + * pthread_create.html: New. + * pthread_delay_np.html: New. + * pthread_detach.html: New. + * pthread_equal.html: New. + * pthread_exit.html: New. + * pthread_getw32threadhandle_np.html: New. + * pthread_join.html: New. + * pthread_key_create.html: New. + * pthread_kill.html: New. + * pthread_mutexattr_init.html: New. + * pthread_mutexattr_setpshared.html: New. + * pthread_mutex_init.html: New. + * pthread_num_processors_np.html: New. + * pthread_once.html: New. + * pthread_rwlockattr_init.html: New. + * pthread_rwlockattr_setpshared.html: New. + * pthread_rwlock_init.html: New. + * pthread_rwlock_rdlock.html: New. + * pthread_rwlock_timedrdlock.html: New. + * pthread_rwlock_timedwrlock.html: New. + * pthread_rwlock_unlock.html: New. + * pthread_rwlock_wrlock.html: New. + * pthread_self.html: New. + * pthread_setcancelstate.html: New. + * pthread_setcanceltype.html: New. + * pthread_setconcurrency.html: New. + * pthread_setschedparam.html: New. + * pthread_spin_init.html: New. + * pthread_spin_lock.html: New. + * pthread_spin_unlock.html: New. + * pthread_timechange_handler_np.html: New. + * pthread_win32_attach_detach_np.html: New. + * pthread_win32_test_features_np.html: New. + * sched_get_priority_max.html: New. + * sched_getscheduler.html: New. + * sched_setscheduler.html: New. + * sched_yield.html: New. + * sem_init.html: New. diff --git a/manual/index.html b/manual/index.html new file mode 100644 index 0000000..3a2b9bd --- /dev/null +++ b/manual/index.html @@ -0,0 +1,140 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE></TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050504;17350500"> + <META NAME="CHANGED" CONTENT="20050505;23534400"> +</HEAD> +<BODY LANG="en-GB" DIR="LTR"> +<H1>POSIX Threads for Windows – Pthreads-w32</H1> +<H2>POSIX threads API reference</H2> +<P STYLE="margin-left: 2cm"><A HREF="pthread_attr_init.html"><B>pthread_attr_destroy</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_attr_init.html"><B>pthread_attr_getdetachstate</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_attr_init.html"><B>pthread_attr_getinheritsched</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_attr_init.html"><B>pthread_attr_getschedparam</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_attr_init.html"><B>pthread_attr_getschedpolicy</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_attr_init.html"><B>pthread_attr_getscope</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_attr_setstackaddr.html"><B>pthread_attr_getstackaddr</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_attr_setstacksize.html"><B>pthread_attr_getstacksize</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_attr_init.html"><B>pthread_attr_init</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_attr_init.html"><B>pthread_attr_setdetachstate</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_attr_init.html"><B>pthread_attr_setinheritsched</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_attr_init.html"><B>pthread_attr_setschedparam</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_attr_init.html"><B>pthread_attr_setschedpolicy</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_attr_init.html"><B>pthread_attr_setscope</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_attr_setstackaddr.html"><B>pthread_attr_setstackaddr</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_attr_setstacksize.html"><B>pthread_attr_setstacksize</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_barrierattr_init.html"><B>pthread_barrierattr_destroy</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_barrierattr_setpshared.html"><B>pthread_barrierattr_getpshared</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_barrierattr_init.html"><B>pthread_barrierattr_init</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_barrierattr_setpshared.html"><B>pthread_barrierattr_setpshared</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_barrier_init.html"><B>pthread_barrier_destroy</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_barrier_init.html"><B>pthread_barrier_init</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_barrier_wait.html"><B>pthread_barrier_wait</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_cancel.html"><B>pthread_cancel</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_cleanup_push.html"><B>pthread_cleanup_pop</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_cleanup_push.html"><B>pthread_cleanup_push</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_condattr_init.html"><B>pthread_condattr_destroy</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_condattr_setpshared.html"><B>pthread_condattr_getpshared</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_condattr_init.html"><B>pthread_condattr_init</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_condattr_setpshared.html"><B>pthread_condattr_setpshared</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_cond_init.html"><B>pthread_cond_broadcast</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_cond_init.html"><B>pthread_cond_destroy</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_cond_init.html"><B>pthread_cond_init</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_cond_init.html"><B>pthread_cond_signal</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_cond_init.html"><B>pthread_cond_timedwait</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_cond_init.html"><B>pthread_cond_wait</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_create.html"><B>pthread_create</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_detach.html"><B>pthread_detach</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_equal.html"><B>pthread_equal</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_exit.html"><B>pthread_exit</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_setconcurrency.html"><B>pthread_getconcurrency</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_setschedparam.html"><B>pthread_getschedparam</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_key_create.html"><B>pthread_getspecific</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_join.html"><B>pthread_join</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_key_create.html"><B>pthread_key_create</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_key_create.html"><B>pthread_key_delete</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_kill.html"><B>pthread_kill</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_mutexattr_init.html"><B>pthread_mutexattr_destroy</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_mutexattr_init.html"><B>pthread_mutexattr_getkind_np</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_mutexattr_setpshared.html"><B>pthread_mutexattr_getpshared</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_mutexattr_init.html"><B>pthread_mutexattr_gettype</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_mutexattr_init.html"><B>pthread_mutexattr_init</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_mutexattr_init.html"><B>pthread_mutexattr_setkind_np</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_mutexattr_setpshared.html"><B>pthread_mutexattr_setpshared</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_mutexattr_init.html"><B>pthread_mutexattr_settype</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_mutex_init.html"><B>pthread_mutex_destroy</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_mutex_init.html"><B>pthread_mutex_init</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_mutex_init.html"><B>pthread_mutex_lock</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_mutex_init.html"><B>pthread_mutex_timedlock</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_mutex_init.html"><B>pthread_mutex_trylock</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_mutex_init.html"><B>pthread_mutex_unlock</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_once.html"><B>pthread_once</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_rwlockattr_init.html"><B>pthread_rwlockattr_destroy</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_rwlockattr_setpshared.html"><B>pthread_rwlockattr_getpshared</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_rwlockattr_init.html"><B>pthread_rwlockattr_init</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_rwlockattr_setpshared.html"><B>pthread_rwlockattr_setpshared</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_rwlock_init.html"><B>pthread_rwlock_destroy</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_rwlock_init.html"><B>pthread_rwlock_init</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_rwlock_rdlock.html"><B>pthread_rwlock_rdlock</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_rwlock_timedrdlock.html"><B>pthread_rwlock_timedrdlock</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_rwlock_timedwrlock.html"><B>pthread_rwlock_timedwrlock</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_rwlock_rdlock.html"><B>pthread_rwlock_tryrdlock</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_rwlock_wrlock.html"><B>pthread_rwlock_trywrlock</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_rwlock_unlock.html"><B>pthread_rwlock_unlock</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_rwlock_wrlock.html"><B>pthread_rwlock_wrlock</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_self.html"><B>pthread_self</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_cancel.html"><B>pthread_setcancelstate</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_cancel.html"><B>pthread_setcanceltype</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_setconcurrency.html"><B>pthread_setconcurrency</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_setschedparam.html"><B>pthread_setschedparam</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_key_create.html"><B>pthread_setspecific</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_kill.html"><B>pthread_sigmask</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_spin_init.html"><B>pthread_spin_destroy</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_spin_init.html"><B>pthread_spin_init</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_spin_lock.html"><B>pthread_spin_lock</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_spin_lock.html"><B>pthread_spin_trylock</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_spin_unlock.html"><B>pthread_spin_unlock</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_cancel.html"><B>pthread_testcancel</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="sched_get_priority_max.html"><B>sched_get_priority_max</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="sched_get_priority_max.html"><B>sched_get_priority_min</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="sched_getscheduler.html"><B>sched_getscheduler</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="sched_setscheduler.html"><B>sched_setscheduler</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="sched_yield.html"><B>sched_yield</B></A></P> +<P STYLE="margin-left: 2cm"><B>sem_close</B></P> +<P STYLE="margin-left: 2cm"><A HREF="sem_init.html"><B>sem_destroy</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="sem_init.html"><B>sem_getvalue</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="sem_init.html"><B>sem_init</B></A></P> +<P STYLE="margin-left: 2cm"><B>sem_open</B></P> +<P STYLE="margin-left: 2cm"><A HREF="sem_init.html"><B>sem_post</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="sem_init.html"><B>sem_post_multiple</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="sem_init.html"><B>sem_timedwait</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="sem_init.html"><B>sem_trywait</B></A></P> +<P STYLE="margin-left: 2cm"><B>sem_unlink</B></P> +<P STYLE="margin-left: 2cm"><A HREF="sem_init.html"><B>sem_wait</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_kill.html"><B>sigwait</B></A></P> +<H2>Miscellaneous POSIX thread safe routines provided by Pthreads-w32</H2> +<P STYLE="margin-left: 2cm"><B>asctime_r</B></P> +<P STYLE="margin-left: 2cm"><B>ctime_r</B></P> +<P STYLE="margin-left: 2cm"><B>gmtime_r</B></P> +<P STYLE="margin-left: 2cm"><B>localtime_r</B></P> +<P STYLE="margin-left: 2cm"><B>rand_r</B></P> +<H2>Non-portable Pthreads-w32 routines</H2> +<P STYLE="margin-left: 2cm"><A HREF="pthreadCancelableWait.html"><B>pthreadCancelableTimedWait</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthreadCancelableWait.html"><B>pthreadCancelableWait</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_delay_np.html"><B>pthread_delay_np</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_getw32threadhandle_np.html"><B>pthread_getw32threadhandle_np</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_num_processors_np.html"><B>pthread_num_processors_np</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_win32_test_features_np.html"><B>pthread_win32_test_features_np</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_timechange_handler_np.html"><B>pthread_timechange_handler_np</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_win32_attach_detach_np.html"><B>pthread_win32_process_attach_np</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_win32_attach_detach_np.html"><B>pthread_win32_process_detach_np</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_win32_attach_detach_np.html"><B>pthread_win32_thread_attach_np</B></A></P> +<P STYLE="margin-left: 2cm"><A HREF="pthread_win32_attach_detach_np.html"><B>pthread_win32_thread_detach_np</B></A></P> +<H2>Other</H2> +<P STYLE="margin-left: 2cm"><A HREF="nonPortableIssues.html"><B>Non-portable +issues</B></A></P> +</BODY> +</HTML>
\ No newline at end of file diff --git a/manual/nonPortableIssues.html b/manual/nonPortableIssues.html new file mode 100644 index 0000000..6585f36 --- /dev/null +++ b/manual/nonPortableIssues.html @@ -0,0 +1,718 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>NONPORTABLEISSUES manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;322600"> + <META NAME="CHANGED" CONTENT="20050505;23554500"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P STYLE="font-weight: medium">Non-portable issues</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>Thread priority</B></P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P><B>Thread priority</B></P> +<P STYLE="margin-left: 2cm">POSIX defines a single contiguous range +of numbers that determine a thread's priority. Win32 defines priority +classes - and priority levels relative to these classes. Classes are +simply priority base levels that the defined priority levels are +relative to such that, changing a process's priority class will +change the priority of all of it's threads, while the threads retain +the same relativity to each other.</P> +<P STYLE="margin-left: 2cm">A Win32 system defines a single +contiguous monotonic range of values that define system priority +levels, just like POSIX. However, Win32 restricts individual threads +to a subset of this range on a per-process basis.</P> +<P STYLE="margin-left: 2cm">The following table shows the base +priority levels for combinations of priority class and priority value +in Win32.</P> +<DL> + <DL> + <DD> + <TABLE WIDTH=742 BORDER=0 CELLPADDING=0 CELLSPACING=0 STYLE="page-break-inside: avoid"> + <COL WIDTH=50> + <COL WIDTH=356> + <COL WIDTH=336> + <THEAD> + <TR VALIGN=TOP> + <TD WIDTH=50> + <P ALIGN=CENTER><BR> + </P> + </TD> + <TD WIDTH=356> + <P ALIGN=LEFT><B>Process Priority Class</B></P> + </TD> + <TD WIDTH=336> + <P ALIGN=LEFT><B>Thread Priority Level</B></P> + </TD> + </TR> + </THEAD> + <TBODY> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="1" SDNUM="3081;"> + <P ALIGN=CENTER>1</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>IDLE_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_IDLE</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="1" SDNUM="3081;"> + <P ALIGN=CENTER>1</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>BELOW_NORMAL_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_IDLE</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="1" SDNUM="3081;"> + <P ALIGN=CENTER>1</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>NORMAL_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_IDLE</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="1" SDNUM="3081;"> + <P ALIGN=CENTER>1</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>ABOVE_NORMAL_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_IDLE</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="1" SDNUM="3081;"> + <P ALIGN=CENTER>1</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>HIGH_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_IDLE</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="2" SDNUM="3081;"> + <P ALIGN=CENTER>2</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>IDLE_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_LOWEST</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="3" SDNUM="3081;"> + <P ALIGN=CENTER>3</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>IDLE_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_BELOW_NORMAL</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="4" SDNUM="3081;"> + <P ALIGN=CENTER>4</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>IDLE_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_NORMAL</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="4" SDNUM="3081;"> + <P ALIGN=CENTER>4</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>BELOW_NORMAL_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_LOWEST</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="5" SDNUM="3081;"> + <P ALIGN=CENTER>5</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>IDLE_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_ABOVE_NORMAL</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="5" SDNUM="3081;"> + <P ALIGN=CENTER>5</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>BELOW_NORMAL_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_BELOW_NORMAL</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="5" SDNUM="3081;"> + <P ALIGN=CENTER>5</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>Background NORMAL_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_LOWEST</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="6" SDNUM="3081;"> + <P ALIGN=CENTER>6</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>IDLE_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_HIGHEST</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="6" SDNUM="3081;"> + <P ALIGN=CENTER>6</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>BELOW_NORMAL_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_NORMAL</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="6" SDNUM="3081;"> + <P ALIGN=CENTER>6</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>Background NORMAL_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_BELOW_NORMAL</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="7" SDNUM="3081;"> + <P ALIGN=CENTER>7</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>BELOW_NORMAL_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_ABOVE_NORMAL</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="7" SDNUM="3081;"> + <P ALIGN=CENTER>7</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>Background NORMAL_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_NORMAL</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="7" SDNUM="3081;"> + <P ALIGN=CENTER>7</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>Foreground NORMAL_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_LOWEST</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="8" SDNUM="3081;"> + <P ALIGN=CENTER>8</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>BELOW_NORMAL_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_HIGHEST</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="8" SDNUM="3081;"> + <P ALIGN=CENTER>8</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>NORMAL_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_ABOVE_NORMAL</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="8" SDNUM="3081;"> + <P ALIGN=CENTER>8</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>Foreground NORMAL_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_BELOW_NORMAL</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="8" SDNUM="3081;"> + <P ALIGN=CENTER>8</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>ABOVE_NORMAL_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_LOWEST</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="9" SDNUM="3081;"> + <P ALIGN=CENTER>9</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>NORMAL_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_HIGHEST</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="9" SDNUM="3081;"> + <P ALIGN=CENTER>9</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>Foreground NORMAL_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_NORMAL</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="9" SDNUM="3081;"> + <P ALIGN=CENTER>9</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>ABOVE_NORMAL_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_BELOW_NORMAL</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="10" SDNUM="3081;"> + <P ALIGN=CENTER>10</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>Foreground NORMAL_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_ABOVE_NORMAL</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="10" SDNUM="3081;"> + <P ALIGN=CENTER>10</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>ABOVE_NORMAL_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_NORMAL</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="11" SDNUM="3081;"> + <P ALIGN=CENTER>11</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>Foreground NORMAL_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_HIGHEST</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="11" SDNUM="3081;"> + <P ALIGN=CENTER>11</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>ABOVE_NORMAL_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_ABOVE_NORMAL</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="11" SDNUM="3081;"> + <P ALIGN=CENTER>11</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>HIGH_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_LOWEST</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="12" SDNUM="3081;"> + <P ALIGN=CENTER>12</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>ABOVE_NORMAL_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_HIGHEST</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="12" SDNUM="3081;"> + <P ALIGN=CENTER>12</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>HIGH_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_BELOW_NORMAL</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="13" SDNUM="3081;"> + <P ALIGN=CENTER>13</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>HIGH_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_NORMAL</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="14" SDNUM="3081;"> + <P ALIGN=CENTER>14</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>HIGH_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_ABOVE_NORMAL</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="15" SDNUM="3081;"> + <P ALIGN=CENTER>15</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>HIGH_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_HIGHEST</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="15" SDNUM="3081;"> + <P ALIGN=CENTER>15</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>HIGH_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_TIME_CRITICAL</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="15" SDNUM="3081;"> + <P ALIGN=CENTER>15</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>IDLE_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_TIME_CRITICAL</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="15" SDNUM="3081;"> + <P ALIGN=CENTER>15</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>BELOW_NORMAL_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_TIME_CRITICAL</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="15" SDNUM="3081;"> + <P ALIGN=CENTER>15</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>NORMAL_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_TIME_CRITICAL</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="15" SDNUM="3081;"> + <P ALIGN=CENTER>15</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>ABOVE_NORMAL_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_TIME_CRITICAL</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="16" SDNUM="3081;"> + <P ALIGN=CENTER>16</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_IDLE</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="17" SDNUM="3081;"> + <P ALIGN=CENTER>17</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=BOTTOM SDVAL="-7" SDNUM="3081;"> + <P ALIGN=LEFT>-7</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="18" SDNUM="3081;"> + <P ALIGN=CENTER>18</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=BOTTOM SDVAL="-6" SDNUM="3081;"> + <P ALIGN=LEFT>-6</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="19" SDNUM="3081;"> + <P ALIGN=CENTER>19</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=BOTTOM SDVAL="-5" SDNUM="3081;"> + <P ALIGN=LEFT>-5</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="20" SDNUM="3081;"> + <P ALIGN=CENTER>20</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=BOTTOM SDVAL="-4" SDNUM="3081;"> + <P ALIGN=LEFT>-4</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="21" SDNUM="3081;"> + <P ALIGN=CENTER>21</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=BOTTOM SDVAL="-3" SDNUM="3081;"> + <P ALIGN=LEFT>-3</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="22" SDNUM="3081;"> + <P ALIGN=CENTER>22</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_LOWEST</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="23" SDNUM="3081;"> + <P ALIGN=CENTER>23</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_BELOW_NORMAL</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="24" SDNUM="3081;"> + <P ALIGN=CENTER>24</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_NORMAL</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="25" SDNUM="3081;"> + <P ALIGN=CENTER>25</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_ABOVE_NORMAL</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="26" SDNUM="3081;"> + <P ALIGN=CENTER>26</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_HIGHEST</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="27" SDNUM="3081;"> + <P ALIGN=CENTER>27</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=BOTTOM SDVAL="3" SDNUM="3081;"> + <P ALIGN=LEFT>3</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="28" SDNUM="3081;"> + <P ALIGN=CENTER>28</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=BOTTOM SDVAL="4" SDNUM="3081;"> + <P ALIGN=LEFT>4</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="29" SDNUM="3081;"> + <P ALIGN=CENTER>29</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=BOTTOM SDVAL="5" SDNUM="3081;"> + <P ALIGN=LEFT>5</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="30" SDNUM="3081;"> + <P ALIGN=CENTER>30</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=BOTTOM SDVAL="6" SDNUM="3081;"> + <P ALIGN=LEFT>6</P> + </TD> + </TR> + <TR> + <TD WIDTH=50 VALIGN=BOTTOM SDVAL="31" SDNUM="3081;"> + <P ALIGN=CENTER>31</P> + </TD> + <TD WIDTH=356 VALIGN=TOP> + <P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P> + </TD> + <TD WIDTH=336 VALIGN=TOP> + <P ALIGN=LEFT>THREAD_PRIORITY_TIME_CRITICAL</P> + </TD> + </TR> + </TBODY> + </TABLE> + </DL> +</DL> +<P STYLE="margin-left: 2cm">Windows NT: Values -7, -6, -5, -4, -3, 3, +4, 5, and 6 are not supported.</P> +<P STYLE="margin-left: 2cm">As you can see, the real priority levels +available to any individual Win32 thread are non-contiguous.</P> +<P STYLE="margin-left: 2cm">An application using Pthreads-w32 should +not make assumptions about the numbers used to represent thread +priority levels, except that they are monotonic between the values +returned by sched_get_priority_min() and sched_get_priority_max(). +E.g. Windows 95, 98, NT, 2000, XP make available a non-contiguous +range of numbers between -15 and 15, while at least one version of +WinCE (3.0) defines the minimum priority (THREAD_PRIORITY_LOWEST) as +5, and the maximum priority (THREAD_PRIORITY_HIGHEST) as 1.</P> +<P STYLE="margin-left: 2cm">Internally, pthreads-win32 maps any +priority levels between THREAD_PRIORITY_IDLE and +THREAD_PRIORITY_LOWEST to THREAD_PRIORITY_LOWEST, or between +THREAD_PRIORITY_TIME_CRITICAL and THREAD_PRIORITY_HIGHEST to +THREAD_PRIORITY_HIGHEST. Currently, this also applies to +REALTIME_PRIORITY_CLASS even if levels -7, -6, -5, -4, -3, 3, 4, 5, +and 6 are supported.</P> +<P STYLE="margin-left: 2cm">If it wishes, a Win32 application using +pthreads-w32 can use the Win32 defined priority macros +THREAD_PRIORITY_IDLE through THREAD_PRIORITY_TIME_CRITICAL.</P> +<H2><A HREF="#toc3" NAME="sect3">Author</A></H2> +<P>Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<H2><A HREF="#toc4" NAME="sect4">See also</A></H2> +<P><BR><BR> +</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Author</A> + </P> + <LI><P><A HREF="#sect4" NAME="toc4">See also</A> + </P> +</UL> +</BODY> +</HTML>
\ No newline at end of file diff --git a/manual/pthreadCancelableWait.html b/manual/pthreadCancelableWait.html new file mode 100644 index 0000000..760f0c7 --- /dev/null +++ b/manual/pthreadCancelableWait.html @@ -0,0 +1,84 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>PTHREADCANCELLABLEWAIT manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;322600"> + <META NAME="CHANGED" CONTENT="20050505;23242300"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P STYLE="font-weight: medium">pthreadCancelableTimedWait, +pthreadCancelableWait – provide cancellation hooks for user Win32 +routines</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h></B> +</P> +<P><B>int pthreadCancelableTimedWait (HANDLE </B><I>waitHandle</I><B>, +DWORD </B><I>timeout</I><B>);</B></P> +<P><B>int pthreadCancelableWait (HANDLE </B><I>waitHandle</I><B>);</B></P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>These two functions provide hooks into the <A HREF="pthread_cancel.html"><B>pthread_cancel</B></A>() +mechanism that will allow you to wait on a Windows handle and make it +a cancellation point. Both functions block until either the given +Win32 <B>HANDLE</B> is signalled, or <A HREF="pthread_cancel.html"><B>pthread_cancel</B></A>() +has been called. They are implemented using <B>WaitForMultipleObjects</B> +on <I>waitHandle</I> and the manually reset Win32 event handle that +is the target of <A HREF="pthread_cancel.html"><B>pthread_cancel</B></A>(). +These routines may be called from Win32 native threads but +<A HREF="pthread_cancel.html"><B>pthread_cancel</B></A>() will +require that thread's POSIX thread ID that the thread must retrieve +using <A HREF="pthread_self.html"><B>pthread_self</B></A>().</P> +<P><B>pthreadCancelableTimedWait</B> is the timed version that will +return with the code <B>ETIMEDOUT</B> if the interval <I>timeout</I> +milliseconds elapses before <I>waitHandle</I> is signalled.</P> +<H2><A HREF="#toc3" NAME="sect3">Cancellation</A></H2> +<P>These routines allow routines that block on Win32 HANDLEs to be +cancellable via <A HREF="pthread_cancel.html"><B>pthread_cancel</B></A>().</P> +<H2><A HREF="#toc4" NAME="sect4">Return Value</A></H2> +<P><BR><BR> +</P> +<H2><A HREF="#toc5" NAME="sect5">Errors</A></H2> +<P>The <B>pthreadCancelableTimedWait</B> function returns the +following error code on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ETIMEDOUT</B> + </DT></DL> +</DL> +<P STYLE="margin-left: 2cm"> +The interval <I>timeout</I> milliseconds elapsed before <I>waitHandle</I> +was signalled.</P> +<H2><A HREF="#toc6" NAME="sect6">Author</A></H2> +<P>Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<H2><A HREF="#toc7" NAME="sect7">See also</A></H2> +<P><A HREF="pthread_cancel.html"><B>pthread_cancel()</B></A>, +<A HREF="pthread_self.html"><B>pthread_self()</B></A></P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Cancellation</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4"></A><A HREF="#sect4" NAME="toc4">Return + Value</A><A HREF="#sect4" NAME="toc4"></A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Author</A> + </P> + <LI><P><A HREF="#sect7" NAME="toc7">See also</A> + </P> +</UL> +</BODY> +</HTML>
\ No newline at end of file diff --git a/manual/pthread_attr_init.html b/manual/pthread_attr_init.html new file mode 100644 index 0000000..8947cf3 --- /dev/null +++ b/manual/pthread_attr_init.html @@ -0,0 +1,278 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>PTHREAD_ATTR_INIT(3) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050504;10092900"> + <META NAME="CHANGED" CONTENT="20050505;16540200"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_attr_init, pthread_attr_destroy, +pthread_attr_setdetachstate, pthread_attr_getdetachstate, +pthread_attr_setschedparam, pthread_attr_getschedparam, +pthread_attr_setschedpolicy, pthread_attr_getschedpolicy, +pthread_attr_setinheritsched, pthread_attr_getinheritsched, +pthread_attr_setscope, pthread_attr_getscope - thread creation +attributes +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h></B> +</P> +<P><B>int pthread_attr_init(pthread_attr_t *</B><I>attr</I><B>);</B> +</P> +<P><B>int pthread_attr_destroy(pthread_attr_t *</B><I>attr</I><B>);</B> +</P> +<P><B>int pthread_attr_setdetachstate(pthread_attr_t *</B><I>attr</I><B>, +int </B><I>detachstate</I><B>);</B> +</P> +<P><B>int pthread_attr_getdetachstate(const pthread_attr_t *</B><I>attr</I><B>, +int *</B><I>detachstate</I><B>);</B> +</P> +<P><B>int pthread_attr_setschedpolicy(pthread_attr_t *</B><I>attr</I><B>, +int </B><I>policy</I><B>);</B> +</P> +<P><B>int pthread_attr_getschedpolicy(const pthread_attr_t *</B><I>attr</I><B>, +int *</B><I>policy</I><B>);</B> +</P> +<P><B>int pthread_attr_setschedparam(pthread_attr_t *</B><I>attr</I><B>, +const struct sched_param *</B><I>param</I><B>);</B> +</P> +<P><B>int pthread_attr_getschedparam(const pthread_attr_t *</B><I>attr</I><B>, +struct sched_param *</B><I>param</I><B>);</B> +</P> +<P><B>int pthread_attr_setinheritsched(pthread_attr_t *</B><I>attr</I><B>, +int </B><I>inherit</I><B>);</B> +</P> +<P><B>int pthread_attr_getinheritsched(const pthread_attr_t *</B><I>attr</I><B>, +int *</B><I>inherit</I><B>);</B> +</P> +<P><B>int pthread_attr_setscope(pthread_attr_t *</B><I>attr</I><B>, +int </B><I>scope</I><B>);</B> +</P> +<P><B>int pthread_attr_getscope(const pthread_attr_t *</B><I>attr</I><B>, +int *</B><I>scope</I><B>);</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>Setting attributes for threads is achieved by filling a thread +attribute object <I>attr</I> of type <B>pthread_attr_t</B>, then +passing it as second argument to <A HREF="pthread_create.html"><B>pthread_create</B>(3)</A> +. Passing <B>NULL</B> is equivalent to passing a thread attribute +object with all attributes set to their default values. +</P> +<P><B>pthread_attr_init</B> initializes the thread attribute object +<I>attr</I> and fills it with default values for the attributes. (The +default values are listed below for each attribute.) +</P> +<P>Each attribute <I>attrname</I> (see below for a list of all +attributes) can be individually set using the function +<B>pthread_attr_set</B><I>attrname</I> and retrieved using the +function <B>pthread_attr_get</B><I>attrname.</I> +</P> +<P><B>pthread_attr_destroy</B> destroys a thread attribute object, +which must not then be reused until it is reinitialized. +</P> +<P>Attribute objects are consulted only when creating a new thread. +The same attribute object can be used for creating several threads. +Modifying an attribute object after a call to <B>pthread_create</B> +does not change the attributes of the thread previously created. +</P> +<P>The following thread attributes are supported: +</P> +<H3><A HREF="#toc3" NAME="sect3">detachstate</A></H3> +<P>Control whether the thread is created in the joinable state (value +<B>PTHREAD_CREATE_JOINABLE</B>) or in the detached state ( +<B>PTHREAD_CREATE_DETACHED</B>). +</P> +<P>Default value: <B>PTHREAD_CREATE_JOINABLE</B>. +</P> +<P>In the joinable state, another thread can synchronize on the +thread termination and recover its termination code using +<A HREF="pthread_join.html"><B>pthread_join</B>(3)</A> . When a +joinable thread terminates, some of the thread resources are kept +allocated, and released only when another thread performs +<A HREF="pthread_join.html"><B>pthread_join</B>(3)</A> on that +thread. +</P> +<P>In the detached state, the thread's resources are released +immediately when it terminates. <A HREF="pthread_join.html"><B>pthread_join</B>(3)</A> +cannot be used to synchronize on the thread termination. +</P> +<P>A thread created in the joinable state can later be put in the +detached thread using <A HREF="pthread_detach.html"><B>pthread_detach</B>(3)</A> +. +</P> +<H3><A HREF="#toc4" NAME="sect4">schedpolicy</A></H3> +<P>Select the scheduling policy for the thread: one of <B>SCHED_OTHER</B> +(regular, non-real-time scheduling), <B>SCHED_RR</B> (real-time, +round-robin) or <B>SCHED_FIFO</B> (real-time, first-in first-out). +</P> +<P><B>Pthreads-w32</B> only supports <B>SCHED_OTHER</B> - attempting +to set one of the other policies will return an error ENOTSUP.</P> +<P>Default value: <B>SCHED_OTHER</B>. +</P> +<P><B>Pthreads-w32</B> only supports <B>SCHED_OTHER</B> - attempting +to set one of the other policies will return an error ENOTSUP.</P> +<P>The scheduling policy of a thread can be changed after creation +with <A HREF="pthread_setschedparam.html"><B>pthread_setschedparam</B>(3)</A> +. +</P> +<H3><A HREF="#toc5" NAME="sect5">schedparam</A></H3> +<P>Contain the scheduling parameters (essentially, the scheduling +priority) for the thread.</P> +<P><B>Pthreads-w32</B> supports the priority levels defined by the +Windows system it is running on. Under Windows, thread priorities are +relative to the process priority class, which must be set via the +Windows W32 API.</P> +<P>Default value: priority is 0 (Win32 level <B>THREAD_PRIORITY_NORMAL</B>). +</P> +<P>The scheduling priority of a thread can be changed after creation +with <A HREF="pthread_setschedparam.html"><B>pthread_setschedparam</B>(3)</A> +. +</P> +<H3><A HREF="#toc6" NAME="sect6">inheritsched</A></H3> +<P>Indicate whether the scheduling policy and scheduling parameters +for the newly created thread are determined by the values of the +<I>schedpolicy</I> and <I>schedparam</I> attributes (value +<B>PTHREAD_EXPLICIT_SCHED</B>) or are inherited from the parent +thread (value <B>PTHREAD_INHERIT_SCHED</B>). +</P> +<P>Default value: <B>PTHREAD_EXPLICIT_SCHED</B>. +</P> +<H3><A HREF="#toc7" NAME="sect7">scope</A></H3> +<P>Define the scheduling contention scope for the created thread. The +only value supported in the <B>Pthreads-w32</B> implementation is +<B>PTHREAD_SCOPE_SYSTEM</B>, meaning that the threads contend for CPU +time with all processes running on the machine. The other value +specified by the standard, <B>PTHREAD_SCOPE_PROCESS</B>, means that +scheduling contention occurs only between the threads of the running +process.</P> +<P><B>Pthreads-w32</B> only supports <B>PTHREAD_SCOPE_SYSTEM</B>.</P> +<P>Default value: <B>PTHREAD_SCOPE_SYSTEM</B>. +</P> +<H2><A HREF="#toc8" NAME="sect8">Return Value</A></H2> +<P>All functions return 0 on success and a non-zero error code on +error. On success, the <B>pthread_attr_get</B><I>attrname</I> +functions also store the current value of the attribute <I>attrname</I> +in the location pointed to by their second argument. +</P> +<H2><A HREF="#toc9" NAME="sect9">Errors</A></H2> +<P>The <B>pthread_attr_setdetachstate</B> function returns the +following error codes on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + the specified <I>detachstate</I> is not one of + <B>PTHREAD_CREATE_JOINABLE</B> or <B>PTHREAD_CREATE_DETACHED</B>. + </DD></DL> +</DL> +<P> +The <B>pthread_attr_setschedparam</B> function returns the following +error codes on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + the priority specified in <I>param</I> is outside the range of + allowed priorities for the scheduling policy currently in <I>attr</I> + (1 to 99 for <B>SCHED_FIFO</B> and <B>SCHED_RR</B>; 0 for + <B>SCHED_OTHER</B>). + </DD></DL> +</DL> +<P> +The <B>pthread_attr_setschedpolicy</B> function returns the following +error codes on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + the specified <I>policy</I> is not one of <B>SCHED_OTHER</B>, + <B>SCHED_FIFO</B>, or <B>SCHED_RR</B>. + </DD><DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + <B>ENOTSUP</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + <I>policy</I> is not <B>SCHED_OTHER</B>, the only value supported + by <B>Pthreads-w32</B>.</DD></DL> +</DL> +<P> +The <B>pthread_attr_setinheritsched</B> function returns the +following error codes on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + the specified <I>inherit</I> is not one of <B>PTHREAD_INHERIT_SCHED</B> + or <B>PTHREAD_EXPLICIT_SCHED</B>. + </DD></DL> +</DL> +<P> +The <B>pthread_attr_setscope</B> function returns the following error +codes on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + the specified <I>scope</I> is not one of <B>PTHREAD_SCOPE_SYSTEM</B> + or <B>PTHREAD_SCOPE_PROCESS</B>. + </DD><DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + <B>ENOTSUP</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + the specified <I>scope</I> is <B>PTHREAD_SCOPE_PROCESS</B> (not + supported by <B>Pthreads-w32</B>). + </DD></DL> +</DL> +<H2> +<A HREF="#toc10" NAME="sect10">Author</A></H2> +<P>Xavier Leroy <Xavier.Leroy@inria.fr> +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<H2><A HREF="#toc11" NAME="sect11">See Also</A></H2> +<P><A HREF="pthread_create.html"><B>pthread_create</B>(3)</A> , +<A HREF="pthread_join.html"><B>pthread_join</B>(3)</A> , +<A HREF="pthread_detach.html"><B>pthread_detach</B>(3)</A> , +<A HREF="pthread_setschedparam.html"><B>pthread_setschedparam</B>(3)</A> +. +</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">detachstate</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">schedpolicy</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">schedparam</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">inheritsched</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">scope</A> + </P> + </UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect10" NAME="toc10">Author</A> + </P> + <LI><P><A HREF="#sect11" NAME="toc11">See Also</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_attr_setstackaddr.html b/manual/pthread_attr_setstackaddr.html new file mode 100644 index 0000000..8bee3ea --- /dev/null +++ b/manual/pthread_attr_setstackaddr.html @@ -0,0 +1,156 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>"PTHREAD_ATTR_GETSTACKADDR"(P) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050504;11025500"> + <META NAME="CHANGED" CONTENT="20050505;17571400"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_attr_getstackaddr, pthread_attr_setstackaddr - get and set +the stackaddr attribute +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h> </B> +</P> +<P><B>int pthread_attr_getstackaddr(const pthread_attr_t *restrict</B> +<I>attr</I><B>, void **restrict</B> <I>stackaddr</I><B>); <BR>int +pthread_attr_setstackaddr(pthread_attr_t *</B><I>attr</I><B>, void +*</B><I>stackaddr</I><B>); </B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>The <B>pthread_attr_getstackaddr</B> and <B>pthread_attr_setstackaddr</B> +functions, respectively, shall get and set the thread creation +<I>stackaddr</I> attribute in the <I>attr</I> object. +</P> +<P>The <I>stackaddr</I> attribute specifies the location of storage +to be used for the created thread’s stack. The size of the storage +shall be at least {PTHREAD_STACK_MIN}. +</P> +<P><B>Pthreads-w32</B> defines <B>_POSIX_THREAD_ATTR_STACKADDR</B> in +pthread.h as -1 to indicate that these routines are implemented but +cannot used to set or get the stack address. These routines always +return the error ENOSYS when called.</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>Upon successful completion, <B>pthread_attr_getstackaddr</B> and +<B>pthread_attr_setstackaddr</B> shall return a value of 0; +otherwise, an error number shall be returned to indicate the error. +</P> +<P>The <B>pthread_attr_getstackaddr</B> function stores the <I>stackaddr</I> +attribute value in <I>stackaddr</I> if successful. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>The <B>pthread_attr_setstackaddr</B> function always returns the +following error code: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ENOSYS</B></DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + The function is not supported. + </DD></DL> +</DL> +<P> +The <B>pthread_attr_getstackaddr</B> function always returns the +following error code: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ENOSYS</B></DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + The function is not supported. + </DD></DL> +</DL> +<P> +These functions shall not return an error code of [EINTR]. +</P> +<P><I>The following sections are informative.</I> +</P> +<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2> +<P>None. +</P> +<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2> +<P>The specification of the <I>stackaddr</I> attribute presents +several ambiguities that make portable use of these interfaces +impossible. The description of the single address parameter as a +"stack" does not specify a particular relationship between +the address and the "stack" implied by that address. For +example, the address may be taken as the low memory address of a +buffer intended for use as a stack, or it may be taken as the address +to be used as the initial stack pointer register value for the new +thread. These two are not the same except for a machine on which the +stack grows "up" from low memory to high, and on which a +"push" operation first stores the value in memory and then +increments the stack pointer register. Further, on a machine where +the stack grows "down" from high memory to low, +interpretation of the address as the "low memory" address +requires a determination of the intended size of the stack. +IEEE Std 1003.1-2001 has introduced the new interfaces +<A HREF="pthread_attr_setstack.html"><B>pthread_attr_setstack</B>(3)</A> +and <A HREF="pthread_attr_getstack.html"><B>pthread_attr_getstack</B>(3)</A> +to resolve these ambiguities. +</P> +<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2> +<P>None. +</P> +<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2> +<P>None. +</P> +<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2> +<P><A HREF="pthread_attr_init.html"><B>pthread_attr_destroy</B>(3)</A> +, <A HREF="pthread_attr_init.html"><B>pthread_attr_getdetachstate</B>(3)</A> +, <A HREF="pthread_attr_getstack.html"><B>pthread_attr_getstack</B>(3)</A> +, <A HREF="pthread_attr_getstacksize.html"><B>pthread_attr_getstacksize</B>(3)</A> +, <A HREF="pthread_attr_setstack.html"><B>pthread_attr_setstack</B>(3)</A> +, <A HREF="pthread_create.html"><B>pthread_create</B>(3)</A> , the +Base Definitions volume of IEEE Std 1003.1-2001, +<I><limits.h></I>, <I><pthread.h></I> +</P> +<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2> +<P>Portions of this text are reprinted and reproduced in electronic +form from IEEE Std 1003.1, 2003 Edition, Standard for Information +Technology -- Portable Operating System Interface (POSIX), The Open +Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the +Institute of Electrical and Electronics Engineers, Inc and The Open +Group. In the event of any discrepancy between this version and the +original IEEE and The Open Group Standard, the original IEEE and The +Open Group Standard is the referee document. The original Standard +can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A> +. +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application + Usage</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future + Directions</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See + Also</A> + </P> + <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_attr_setstacksize.html b/manual/pthread_attr_setstacksize.html new file mode 100644 index 0000000..574630c --- /dev/null +++ b/manual/pthread_attr_setstacksize.html @@ -0,0 +1,125 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>"PTHREAD_ATTR_GETSTACKSIZE"(P) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050504;11224900"> + <META NAME="CHANGED" CONTENT="20050505;18003200"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_attr_getstacksize, pthread_attr_setstacksize - get and set +the stacksize attribute +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h> </B> +</P> +<P><B>int pthread_attr_getstacksize(const pthread_attr_t *restrict</B> +<I>attr</I><B>, size_t *restrict</B> <I>stacksize</I><B>); <BR>int +pthread_attr_setstacksize(pthread_attr_t *</B><I>attr</I><B>, size_t</B> +<I>stacksize</I><B>); </B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>The <B>pthread_attr_getstacksize</B> and <B>pthread_attr_setstacksize</B> +functions, respectively, shall get and set the thread creation +<I>stacksize</I> attribute in the <I>attr</I> object. +</P> +<P>The <I>stacksize</I> attribute shall define the minimum stack size +(in bytes) allocated for the created threads stack. +</P> +<P><B>Pthreads-w32</B> defines <B>_POSIX_THREAD_ATTR_STACKSIZE</B> in +pthread.h to indicate that these routines are implemented and may be +used to set or get the stack size.</P> +<P>Default value: 0 (in Pthreads-w32 a value of 0 means the stack +will grow as required)</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>Upon successful completion, <B>pthread_attr_getstacksize</B> and +<B>pthread_attr_setstacksize</B> shall return a value of 0; +otherwise, an error number shall be returned to indicate the error. +</P> +<P>The <B>pthread_attr_getstacksize</B> function stores the <I>stacksize</I> +attribute value in <I>stacksize</I> if successful. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>The <B>pthread_attr_setstacksize</B> function shall fail if: +</P> +<DL> + <DT><B>EINVAL</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The value of <I>stacksize</I> is less than {PTHREAD_STACK_MIN} or + exceeds a system-imposed limit. + </DD></DL> +<P> +These functions shall not return an error code of [EINTR]. +</P> +<P><I>The following sections are informative.</I> +</P> +<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2> +<P>None. +</P> +<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2> +<P>None. +</P> +<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2> +<P>None. +</P> +<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2> +<P>None. +</P> +<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2> +<P><A HREF="pthread_attr_init.html"><B>pthread_attr_destroy</B>(3)</A> +<B>,</B> <A HREF="pthread_attr_setstackaddr.html"><B>pthread_attr_getstackaddr</B>(3)</A> +<B>,</B> <A HREF="pthread_attr_init.html"><B>pthread_attr_getdetachstate</B>(3)</A> +<B>,</B> <A HREF="pthread_create.html"><B>pthread_create</B>(3)</A> <B>,</B> +the Base Definitions volume of IEEE Std 1003.1-2001, +<I><limits.h></I>, <I><pthread.h></I> +</P> +<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2> +<P>Portions of this text are reprinted and reproduced in electronic +form from IEEE Std 1003.1, 2003 Edition, Standard for Information +Technology -- Portable Operating System Interface (POSIX), The Open +Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the +Institute of Electrical and Electronics Engineers, Inc and The Open +Group. In the event of any discrepancy between this version and the +original IEEE and The Open Group Standard, the original IEEE and The +Open Group Standard is the referee document. The original Standard +can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A> +. +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application + Usage</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future + Directions</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See + Also</A> + </P> + <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_barrier_init.html b/manual/pthread_barrier_init.html new file mode 100644 index 0000000..1bebca6 --- /dev/null +++ b/manual/pthread_barrier_init.html @@ -0,0 +1,185 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>"PTHREAD_BARRIER_DESTROY"(P) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050504;11372800"> + <META NAME="CHANGED" CONTENT="20050505;18164500"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_barrier_destroy, pthread_barrier_init - destroy and +initialize a barrier object (<B>ADVANCED REALTIME THREADS</B>) +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h> </B> +</P> +<P><B>int pthread_barrier_destroy(pthread_barrier_t *</B><I>barrier</I><B>); +<BR>int pthread_barrier_init(pthread_barrier_t *restrict</B> <I>barrier</I><B>, +const pthread_barrierattr_t *restrict</B> <I>attr</I><B>, unsigned</B> +<I>count</I><B>); </B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>The <B>pthread_barrier_destroy</B> function shall destroy the +barrier referenced by <I>barrier</I> and release any resources used +by the barrier. The effect of subsequent use of the barrier is +undefined until the barrier is reinitialized by another call to +<B>pthread_barrier_init</B> . An implementation may use this function +to set <I>barrier</I> to an invalid value. The results are undefined +if <B>pthread_barrier_destroy</B> is called when any thread is +blocked on the barrier, or if this function is called with an +uninitialized barrier. +</P> +<P>The <B>pthread_barrier_init</B> function shall allocate any +resources required to use the barrier referenced by <I>barrier</I> +and shall initialize the barrier with attributes referenced by <I>attr</I>. +If <I>attr</I> is NULL, the default barrier attributes shall be used; +the effect is the same as passing the address of a default barrier +attributes object. The results are undefined if <B>pthread_barrier_init</B> +is called when any thread is blocked on the barrier (that is, has not +returned from the <A HREF="pthread_barrier_wait.html"><B>pthread_barrier_wait</B>(3)</A> +call). The results are undefined if a barrier is used without first +being initialized. The results are undefined if <B>pthread_barrier_init</B> +is called specifying an already initialized barrier. +</P> +<P>The <I>count</I> argument specifies the number of threads that +must call <A HREF="pthread_barrier_wait.html"><B>pthread_barrier_wait</B>(3)</A> +before any of them successfully return from the call. The value +specified by <I>count</I> must be greater than zero. +</P> +<P>If the <B>pthread_barrier_init</B> function fails, the barrier +shall not be initialized and the contents of <I>barrier</I> are +undefined. +</P> +<P>Only the object referenced by <I>barrier</I> may be used for +performing synchronization. The result of referring to copies of that +object in calls to <B>pthread_barrier_destroy</B> <B>or</B> +<A HREF="pthread_barrier_wait.html"><B>pthread_barrier_wait</B>(3)</A> +is undefined.</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>Upon successful completion, these functions shall return zero; +otherwise, an error number shall be returned to indicate the error. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>The <B>pthread_barrier_destroy</B><SPAN STYLE="font-weight: medium"> +function may fail if:</SPAN> +</P> +<DL> + <DT><B>EBUSY</B> + </DT><DD> + The implementation has detected an attempt to destroy a barrier + while it is in use (for example, while being used in a + <A HREF="pthread_barrier_wait.html"><B>pthread_barrier_wait</B>(3)</A> + call) by another thread. + </DD><DT> + <B>EINVAL</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The value specified by <I>barrier</I> is invalid. + </DD></DL> +<P> +The <B>pthread_barrier_init</B> function shall fail if: +</P> +<DL> + <DT><B>EAGAIN</B> + </DT><DD> + The system lacks the necessary resources to initialize another + barrier. + </DD><DT> + <B>EINVAL</B> + </DT><DD> + The value specified by <I>count</I> is equal to zero. + </DD><DT> + <B>ENOMEM</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + Insufficient memory exists to initialize the barrier. + </DD></DL> +<P> +The <B>pthread_barrier_init</B> function may fail if: +</P> +<DL> + <DT><B>EBUSY</B> + </DT><DD> + The implementation has detected an attempt to reinitialize a barrier + while it is in use (for example, while being used in a + <A HREF="pthread_barrier_wait.html"><B>pthread_barrier_wait</B>(3)</A> + call) by another thread. + </DD><DT> + <B>EINVAL</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The value specified by <I>attr</I> is invalid. + </DD></DL> +<P> +These functions shall not return an error code of [EINTR]. +</P> +<P><I>The following sections are informative.</I> +</P> +<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2> +<P>None. +</P> +<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2> +<P>The <B>pthread_barrier_destroy</B> and <B>pthread_barrier_init</B> +functions are part of the Barriers option and need not be provided on +all implementations. +</P> +<P><B>Pthreads-w32</B> defines <B>_POSIX_BARRIERS</B> to indicate +that these routines are implemented and may be used.</P> +<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2> +<P>None. +</P> +<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2> +<P>None. +</P> +<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2> +<P><A HREF="pthread_barrier_wait.html"><B>pthread_barrier_wait</B>(3)</A> +<B>,</B> the Base Definitions volume of IEEE Std 1003.1-2001, +<I><pthread.h></I> +</P> +<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2> +<P>Portions of this text are reprinted and reproduced in electronic +form from IEEE Std 1003.1, 2003 Edition, Standard for Information +Technology -- Portable Operating System Interface (POSIX), The Open +Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the +Institute of Electrical and Electronics Engineers, Inc and The Open +Group. In the event of any discrepancy between this version and the +original IEEE and The Open Group Standard, the original IEEE and The +Open Group Standard is the referee document. The original Standard +can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A> +. +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application + Usage</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future + Directions</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See + Also</A> + </P> + <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_barrier_wait.html b/manual/pthread_barrier_wait.html new file mode 100644 index 0000000..9ea29db --- /dev/null +++ b/manual/pthread_barrier_wait.html @@ -0,0 +1,150 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>"PTHREAD_BARRIER_WAIT"(P) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050504;11484200"> + <META NAME="CHANGED" CONTENT="20050505;18111200"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_barrier_wait - synchronize at a barrier (<B>ADVANCED +REALTIME THREADS</B>) +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h> </B> +</P> +<P><B>int pthread_barrier_wait(pthread_barrier_t *</B><I>barrier</I><B>); +</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>The <B>pthread_barrier_wait</B> function shall synchronize +participating threads at the barrier referenced by <I>barrier</I>. +The calling thread shall block until the required number of threads +have called <B>pthread_barrier_wait</B> specifying the barrier. +</P> +<P>When the required number of threads have called +<B>pthread_barrier_wait</B> specifying the barrier, the constant +<B>PTHREAD_BARRIER_SERIAL_THREAD</B> shall be returned to one +unspecified thread and zero shall be returned to each of the +remaining threads. At this point, the barrier shall be reset to the +state it had as a result of the most recent <A HREF="pthread_barrier_init.html"><B>pthread_barrier_init</B>(3)</A> +function that referenced it. +</P> +<P>The constant <B>PTHREAD_BARRIER_SERIAL_THREAD</B> is defined in +<I><pthread.h></I> and its value shall be distinct from any +other value returned by <B>pthread_barrier_wait</B> . +</P> +<P>The results are undefined if this function is called with an +uninitialized barrier. +</P> +<P>If a signal is delivered to a thread blocked on a barrier, upon +return from the signal handler the thread shall resume waiting at the +barrier if the barrier wait has not completed (that is, if the +required number of threads have not arrived at the barrier during the +execution of the signal handler); otherwise, the thread shall +continue as normal from the completed barrier wait. Until the thread +in the signal handler returns from it, it is unspecified whether +other threads may proceed past the barrier once they have all reached +it. +</P> +<P>A thread that has blocked on a barrier shall not prevent any +unblocked thread that is eligible to use the same processing +resources from eventually making forward progress in its execution. +Eligibility for processing resources shall be determined by the +scheduling policy. +</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>Upon successful completion, the <B>pthread_barrier_wait</B> +function shall return <B>PTHREAD_BARRIER_SERIAL_THREAD</B> for a +single (arbitrary) thread synchronized at the barrier and zero for +each of the other threads. Otherwise, an error number shall be +returned to indicate the error. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>The <B>pthread_barrier_wait</B> function may fail if: +</P> +<DL> + <DT><B>EINVAL</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The value specified by <I>barrier</I> does not refer to an + initialized barrier object. + </DD></DL> +<P> +This function shall not return an error code of [EINTR]. +</P> +<P><I>The following sections are informative.</I> +</P> +<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2> +<P>None. +</P> +<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2> +<P>Applications using this function may be subject to priority +inversion, as discussed in the Base Definitions volume of +IEEE Std 1003.1-2001, Section 3.285, Priority Inversion. +</P> +<P>The <B>pthread_barrier_wait</B> function is part of the Barriers +option and need not be provided on all implementations. +</P> +<P><B>Pthreads-w32</B> defines <B>_POSIX_BARRIERS</B> to indicate +that this routine is implemented and may be used.</P> +<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2> +<P>None. +</P> +<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2> +<P>None. +</P> +<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2> +<P><A HREF="pthread_barrier_init.html"><B>pthread_barrier_destroy</B>(3)</A> +<B>,</B> the Base Definitions volume of IEEE Std 1003.1-2001, +<I><pthread.h></I> +</P> +<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2> +<P>Portions of this text are reprinted and reproduced in electronic +form from IEEE Std 1003.1, 2003 Edition, Standard for Information +Technology -- Portable Operating System Interface (POSIX), The Open +Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the +Institute of Electrical and Electronics Engineers, Inc and The Open +Group. In the event of any discrepancy between this version and the +original IEEE and The Open Group Standard, the original IEEE and The +Open Group Standard is the referee document. The original Standard +can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A> +. +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application + Usage</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future + Directions</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See + Also</A> + </P> + <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_barrierattr_init.html b/manual/pthread_barrierattr_init.html new file mode 100644 index 0000000..0318fb9 --- /dev/null +++ b/manual/pthread_barrierattr_init.html @@ -0,0 +1,140 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>"PTHREAD_BARRIERATTR_DESTROY"(P) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050504;11502600"> + <META NAME="CHANGED" CONTENT="20050505;18032300"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_barrierattr_destroy, pthread_barrierattr_init - destroy +and initialize the barrier attributes object (<B>ADVANCED REALTIME +THREADS</B>) +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h> </B> +</P> +<P>i<B>nt pthread_barrierattr_destroy(pthread_barrierattr_t *</B><I>attr</I><B>); +<BR>int pthread_barrierattr_init(pthread_barrierattr_t *</B><I>attr</I><B>); +</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>The <B>pthread_barrierattr_destroy</B> function shall destroy a +barrier attributes object. A destroyed <I>attr</I> attributes object +can be reinitialized using <B>pthread_barrierattr_init</B> ; the +results of otherwise referencing the object after it has been +destroyed are undefined. An implementation may cause +<B>pthread_barrierattr_destroy</B> to set the object referenced by +<I>attr</I> to an invalid value. +</P> +<P>The <B>pthread_barrierattr_init</B> function shall initialize a +barrier attributes object <I>attr</I> with the default value for all +of the attributes defined by the implementation. +</P> +<P>Results are undefined if <B>pthread_barrierattr_init</B> is called +specifying an already initialized <I>attr</I> attributes object. +</P> +<P>After a barrier attributes object has been used to initialize one +or more barriers, any function affecting the attributes object +(including destruction) shall not affect any previously initialized +barrier. +</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>If successful, the <B>pthread_barrierattr_destroy</B> and +<B>pthread_barrierattr_init</B> functions shall return zero; +otherwise, an error number shall be returned to indicate the error. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>The <B>pthread_barrierattr_destroy</B> function may fail if: +</P> +<DL> + <DT><B>EINVAL</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The value specified by <I>attr</I> is invalid. + </DD></DL> +<P> +The <B>pthread_barrierattr_init</B> function shall fail if: +</P> +<DL> + <DT><B>ENOMEM</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + Insufficient memory exists to initialize the barrier attributes + object. + </DD></DL> +<P> +These functions shall not return an error code of [EINTR]. +</P> +<P><I>The following sections are informative.</I> +</P> +<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2> +<P>None. +</P> +<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2> +<P>The <B>pthread_barrierattr_destroy</B> and +<B>pthread_barrierattr_init</B> functions are part of the Barriers +option and need not be provided on all implementations. +</P> +<P><B>Pthreads-w32</B> defines <B>_POSIX_BARRIERS</B> to indicate +that these routines are implemented and may be used.</P> +<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2> +<P>None. +</P> +<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2> +<P>None. +</P> +<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2> +<P><A HREF="pthread_barrierattr_setpshared.html"><B>pthread_barrierattr_getpshared</B>(3)</A> +<B>,</B> <A HREF="pthread_barrierattr_setpshared.html"><B>pthread_barrierattr_setpshared</B>(3)</A> +, the Base Definitions volume of IEEE Std 1003.1-2001, +<I><pthread.h></I>. +</P> +<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2> +<P>Portions of this text are reprinted and reproduced in electronic +form from IEEE Std 1003.1, 2003 Edition, Standard for Information +Technology -- Portable Operating System Interface (POSIX), The Open +Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the +Institute of Electrical and Electronics Engineers, Inc and The Open +Group. In the event of any discrepancy between this version and the +original IEEE and The Open Group Standard, the original IEEE and The +Open Group Standard is the referee document. The original Standard +can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A> +. +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application + Usage</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future + Directions</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See + Also</A> + </P> + <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_barrierattr_setpshared.html b/manual/pthread_barrierattr_setpshared.html new file mode 100644 index 0000000..d602ed0 --- /dev/null +++ b/manual/pthread_barrierattr_setpshared.html @@ -0,0 +1,157 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>"PTHREAD_BARRIERATTR_GETPSHARED"(P) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050504;11552100"> + <META NAME="CHANGED" CONTENT="20050505;18080400"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_barrierattr_getpshared, pthread_barrierattr_setpshared - +get and set the process-shared attribute of the barrier attributes +object (<B>ADVANCED REALTIME THREADS</B>) +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h> </B> +</P> +<P><B>int pthread_barrierattr_getpshared(const pthread_barrierattr_t +* restrict</B> <I>attr</I><B>, int *restrict</B> <I>pshared</I><B>); +<BR>int pthread_barrierattr_setpshared(pthread_barrierattr_t *</B><I>attr</I><B>, +int</B> <I>pshared</I><B>); </B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>The <B>pthread_barrierattr_getpshared</B> function shall obtain +the value of the <I>process-shared</I> attribute from the attributes +object referenced by <I>attr</I>. The <B>pthread_barrierattr_setpshared</B> +function shall set the <I>process-shared</I> attribute in an +initialized attributes object referenced by <I>attr</I>. +</P> +<P>The <I>process-shared</I> attribute is set to +PTHREAD_PROCESS_SHARED to permit a barrier to be operated upon by any +thread that has access to the memory where the barrier is allocated. +If the <I>process-shared</I> attribute is PTHREAD_PROCESS_PRIVATE, +the barrier shall only be operated upon by threads created within the +same process as the thread that initialized the barrier; if threads +of different processes attempt to operate on such a barrier, the +behavior is undefined. The default value of the attribute shall be +PTHREAD_PROCESS_PRIVATE. Both constants PTHREAD_PROCESS_SHARED and +PTHREAD_PROCESS_PRIVATE are defined in <I><pthread.h></I>. +</P> +<P><B>Pthreads-w32</B> defines _<B>POSIX_THREAD_PROCESS_SHARED</B> in +pthread.h as -1 to indicate that these routines are implemented but +that the process shared attribute is not supported.</P> +<P>Additional attributes, their default values, and the names of the +associated functions to get and set those attribute values are +implementation-defined. +</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>If successful, the <B>pthread_barrierattr_getpshared</B> function +shall return zero and store the value of the <I>process-shared</I> +attribute of <I>attr</I> into the object referenced by the <I>pshared</I> +parameter. Otherwise, an error number shall be returned to indicate +the error. +</P> +<P>If successful, the <B>pthread_barrierattr_setpshared</B> function +shall return zero; otherwise, an error number shall be returned to +indicate the error. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>These functions may fail if: +</P> +<DL> + <DT><B>EINVAL</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The value specified by <I>attr</I> is invalid. + </DD><DT> + The <B>pthread_barrierattr_setpshared</B> function may fail if: + </DT><DT> + <B>EINVAL</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The new value specified for the <I>process-shared</I> attribute is + not one of the legal values <B>PTHREAD_PROCESS_SHARED</B> or + <B>PTHREAD_PROCESS_PRIVATE</B>. + </DD><DT> + <B>ENOSYS</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The value specified by <I>attr</I> was <B>PTHREAD_PROCESS_SHARED</B> + (Pthreads-w32).</DD></DL> +<P> +These functions shall not return an error code of [EINTR]. +</P> +<P><I>The following sections are informative.</I> +</P> +<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2> +<P>None. +</P> +<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2> +<P>The <B>pthread_barrierattr_getpshared</B> and +<B>pthread_barrierattr_setpshared</B> functions are part of the +Barriers option and need not be provided on all implementations. +</P> +<P><B>Pthreads-w32</B> defines <B>_POSIX_BARRIERS</B> and +<B>_POSIX_THREAD_PROCESS_SHARED</B> in pthread.h as -1 to indicate +that these routines are implemented and may be used, but do not +support the process shared option.</P> +<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2> +<P>None. +</P> +<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2> +<P>None. +</P> +<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2> +<P><A HREF="pthread_barrier_init.html"><B>pthread_barrier_destroy</B>(3)</A> +<B>,</B> <A HREF="pthread_barrierattr_init.html"><B>pthread_barrierattr_destroy</B>(3)</A> +<B>,</B> <A HREF="pthread_barrierattr_init.html"><B>pthread_barrierattr_init</B>(3)</A> +<B>,</B> the Base Definitions volume of IEEE Std 1003.1-2001, +<I><pthread.h></I> +</P> +<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2> +<P>Portions of this text are reprinted and reproduced in electronic +form from IEEE Std 1003.1, 2003 Edition, Standard for Information +Technology -- Portable Operating System Interface (POSIX), The Open +Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the +Institute of Electrical and Electronics Engineers, Inc and The Open +Group. In the event of any discrepancy between this version and the +original IEEE and The Open Group Standard, the original IEEE and The +Open Group Standard is the referee document. The original Standard +can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A> +. +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application + Usage</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future + Directions</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See + Also</A> + </P> + <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_cancel.html b/manual/pthread_cancel.html new file mode 100644 index 0000000..d8a6429 --- /dev/null +++ b/manual/pthread_cancel.html @@ -0,0 +1,203 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>PTHREAD_CANCEL(3) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050504;12090500"> + <META NAME="CHANGED" CONTENT="20050505;18220000"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_cancel, pthread_setcancelstate, pthread_setcanceltype, +pthread_testcancel - thread cancellation +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h></B> +</P> +<P><B>int pthread_cancel(pthread_t </B><I>thread</I><B>);</B> +</P> +<P><B>int pthread_setcancelstate(int </B><I>state</I><B>, int +*</B><I>oldstate</I><B>);</B> +</P> +<P><B>int pthread_setcanceltype(int </B><I>type</I><B>, int +*</B><I>oldtype</I><B>);</B> +</P> +<P><B>void pthread_testcancel(void);</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>Cancellation is the mechanism by which a thread can terminate the +execution of another thread. More precisely, a thread can send a +cancellation request to another thread. Depending on its settings, +the target thread can then either ignore the request, honor it +immediately, or defer it until it reaches a cancellation point. +</P> +<P>When a thread eventually honors a cancellation request, it +performs as if <B>pthread_exit(PTHREAD_CANCELED)</B> has been called +at that point: all cleanup handlers are executed in reverse order, +destructor functions for thread-specific data are called, and finally +the thread stops executing with the return value <B>PTHREAD_CANCELED</B>. +See <A HREF="pthread_exit.html"><B>pthread_exit</B>(3)</A> for more +information. +</P> +<P><B>pthread_cancel</B> sends a cancellation request to the thread +denoted by the <I>thread</I> argument. +</P> +<P><B>pthread_setcancelstate</B> changes the cancellation state for +the calling thread -- that is, whether cancellation requests are +ignored or not. The <I>state</I> argument is the new cancellation +state: either <B>PTHREAD_CANCEL_ENABLE</B> to enable cancellation, or +<B>PTHREAD_CANCEL_DISABLE</B> to disable cancellation (cancellation +requests are ignored). If <I>oldstate</I> is not <B>NULL</B>, the +previous cancellation state is stored in the location pointed to by +<I>oldstate</I>, and can thus be restored later by another call to +<B>pthread_setcancelstate</B>. +</P> +<P><B>pthread_setcanceltype</B> changes the type of responses to +cancellation requests for the calling thread: asynchronous +(immediate) or deferred. The <I>type</I> argument is the new +cancellation type: either <B>PTHREAD_CANCEL_ASYNCHRONOUS</B> to +cancel the calling thread as soon as the cancellation request is +received, or <B>PTHREAD_CANCEL_DEFERRED</B> to keep the cancellation +request pending until the next cancellation point. If <I>oldtype</I> +is not <B>NULL</B>, the previous cancellation state is stored in the +location pointed to by <I>oldtype</I>, and can thus be restored later +by another call to <B>pthread_setcanceltype</B>. +</P> +<P><B>Pthreads-w32</B> provides two levels of support for +<B>PTHREAD_CANCEL_ASYNCHRONOUS</B>: full and partial. Full support +requires an additional DLL and driver be installed on the Windows +system (see the See Also section below) that allows blocked threads +to be cancelled immediately. Partial support means that the target +thread will not cancel until it resumes execution naturally. Partial +support is provided if either the DLL or the driver are not +automatically detected by the pthreads-w32 library at run-time.</P> +<P>Threads are always created by <A HREF="pthread_create.html"><B>pthread_create</B>(3)</A> +with cancellation enabled and deferred. That is, the initial +cancellation state is <B>PTHREAD_CANCEL_ENABLE</B> and the initial +type is <B>PTHREAD_CANCEL_DEFERRED</B>. +</P> +<P>Cancellation points are those points in the program execution +where a test for pending cancellation requests is performed and +cancellation is executed if positive. The following POSIX threads +functions are cancellation points: +</P> +<P><A HREF="pthread_join.html"><B>pthread_join</B>(3)</A> +<BR><A HREF="pthread_cond_init.html"><B>pthread_cond_wait</B>(3)</A> +<BR><A HREF="pthread_cond_init.html"><B>pthread_cond_timedwait</B>(3)</A> +<BR><A HREF=""><B>pthread_testcancel</B>(3)</A> <BR><A HREF="sem_init.html"><B>sem_wait</B>(3)</A> +<BR><A HREF="sem_init.html"><B>sem_timedwait</B>(3)</A> <BR><A HREF="pthread_kill.html"><B>sigwait</B>(3)</A></P> +<P><B>Pthreads-w32</B> provides two functions to enable additional +cancellation points to be created in user functions that block on +Win32 HANDLEs:</P> +<P><A HREF="pthreadCancelableWait.html">pthreadCancelableWait()</A> +<BR><A HREF="pthreadCancelableTimedWait.html">pthreadCancelableTimedWait()</A></P> +<P>All other POSIX threads functions are guaranteed not to be +cancellation points. That is, they never perform cancellation in +deferred cancellation mode. +</P> +<P><B>pthread_testcancel</B> does nothing except testing for pending +cancellation and executing it. Its purpose is to introduce explicit +checks for cancellation in long sequences of code that do not call +cancellation point functions otherwise. +</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P><B>pthread_cancel</B>, <B>pthread_setcancelstate</B> and +<B>pthread_setcanceltype</B> return 0 on success and a non-zero error +code on error. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P><B>pthread_cancel</B> returns the following error code on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ESRCH</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + no thread could be found corresponding to that specified by the + <I>thread</I> ID. + </DD></DL> +</DL> +<P> +<B>pthread_setcancelstate</B> returns the following error code on +error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + the <I>state</I> argument is not + </DD></DL> +</DL> +<BLOCKQUOTE> +<B>PTHREAD_CANCEL_ENABLE</B> nor <B>PTHREAD_CANCEL_DISABLE</B> +</BLOCKQUOTE> +<P><B>pthread_setcanceltype</B> returns the following error code on +error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + the <I>type</I> argument is not + </DD></DL> +</DL> +<BLOCKQUOTE> +<B>PTHREAD_CANCEL_DEFERRED</B> nor <B>PTHREAD_CANCEL_ASYNCHRONOUS</B> +</BLOCKQUOTE> +<H2><A HREF="#toc5" NAME="sect5">Author</A></H2> +<P>Xavier Leroy <Xavier.Leroy@inria.fr> +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<H2><A HREF="#toc6" NAME="sect6">See Also</A></H2> +<P><A HREF="pthread_exit.html"><B>pthread_exit</B>(3)</A> , +<A HREF="pthread_cleanup_push.html"><B>pthread_cleanup_push</B>(3)</A> +, <A HREF="pthread_cleanup_pop.html"><B>pthread_cleanup_pop</B>(3)</A> +, Pthreads-w32 package README file 'Prerequisites' section. +</P> +<H2><A HREF="#toc7" NAME="sect7">Bugs</A></H2> +<P>POSIX specifies that a number of system calls (basically, all +system calls that may block, such as <A HREF="read.html"><B>read</B>(2)</A> +, <A HREF="write.html"><B>write</B>(2)</A> , <A HREF="wait.html"><B>wait</B>(2)</A> +, etc.) and library functions that may call these system calls (e.g. +<A HREF="fprintf.html"><B>fprintf</B>(3)</A> ) are cancellation +points. <B>Pthreads-win32</B> is not integrated enough with the C +library to implement this, and thus none of the C library functions +is a cancellation point. +</P> +<P>A workaround for these calls is to temporarily switch to +asynchronous cancellation (assuming full asynchronous cancellation +support is installed). So, checking for cancellation during a <B>read</B> +system call, for instance, can be achieved as follows: +</P> +<BLOCKQUOTE><BR><BR> +</BLOCKQUOTE> +<PRE STYLE="margin-left: 1cm; margin-right: 1cm">pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldCancelType); +read(fd, buffer, length); +pthread_setcanceltype(oldCancelType, NULL);</PRE> +<HR> +<BLOCKQUOTE><A NAME="toc"></A><B>Table of Contents</B></BLOCKQUOTE> +<UL> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Author</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">See + Also</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE><A HREF="#sect7" NAME="toc7">Bugs</A> + </BLOCKQUOTE> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_cleanup_push.html b/manual/pthread_cleanup_push.html new file mode 100644 index 0000000..9618e0a --- /dev/null +++ b/manual/pthread_cleanup_push.html @@ -0,0 +1,138 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>PTHREAD_CLEANUP(3) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050504;20152200"> + <META NAME="CHANGED" CONTENT="20050505;18252600"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_cleanup_push, pthread_cleanup_pop - install and remove +cleanup handlers +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h></B> +</P> +<P><B>void pthread_cleanup_push(void (*</B><I>routine</I><B>) (void +*), void *</B><I>arg</I><B>);</B> +</P> +<P><B>void pthread_cleanup_pop(int </B><I>execute</I><B>);</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>Cleanup handlers are functions that get called when a thread +terminates, either by calling <A HREF="pthread_exit.html"><B>pthread_exit</B>(3)</A> +or because of cancellation. Cleanup handlers are installed and +removed following a stack-like discipline. +</P> +<P>The purpose of cleanup handlers is to free the resources that a +thread may hold at the time it terminates. In particular, if a thread +exits or is cancelled while it owns a locked mutex, the mutex will +remain locked forever and prevent other threads from executing +normally. The best way to avoid this is, just before locking the +mutex, to install a cleanup handler whose effect is to unlock the +mutex. Cleanup handlers can be used similarly to free blocks +allocated with <A HREF="malloc.html"><B>malloc</B>(3)</A> or close +file descriptors on thread termination. +</P> +<P><B>pthread_cleanup_push</B> installs the <I>routine</I> function +with argument <I>arg</I> as a cleanup handler. From this point on to +the matching <B>pthread_cleanup_pop</B>, the function <I>routine</I> +will be called with arguments <I>arg</I> when the thread terminates, +either through <A HREF="pthread_exit.html"><B>pthread_exit</B>(3)</A> +or by cancellation. If several cleanup handlers are active at that +point, they are called in LIFO order: the most recently installed +handler is called first. +</P> +<P><B>pthread_cleanup_pop</B> removes the most recently installed +cleanup handler. If the <I>execute</I> argument is not 0, it also +executes the handler, by calling the <I>routine</I> function with +arguments <I>arg</I>. If the <I>execute</I> argument is 0, the +handler is only removed but not executed. +</P> +<P>Matching pairs of <B>pthread_cleanup_push</B> and +<B>pthread_cleanup_pop</B> must occur in the same function, at the +same level of block nesting. Actually, <B>pthread_cleanup_push</B> +and <B>pthread_cleanup_pop</B> are macros, and the expansion of +<B>pthread_cleanup_push</B> introduces an open brace <B>{</B> with +the matching closing brace <B>}</B> being introduced by the expansion +of the matching <B>pthread_cleanup_pop</B>. +</P> +<H2 STYLE="margin-top: 0cm"><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<BLOCKQUOTE STYLE="margin-left: 0cm; margin-right: 0cm">None. +</BLOCKQUOTE> +<H2 STYLE="margin-top: 0cm"><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<BLOCKQUOTE STYLE="margin-left: 0cm; margin-right: 0cm">None. +</BLOCKQUOTE> +<H2 STYLE="margin-top: 0cm"><A HREF="#toc5" NAME="sect5">Author</A></H2> +<BLOCKQUOTE STYLE="margin-left: 0cm; margin-right: 0cm">Xavier Leroy +<Xavier.Leroy@inria.fr> +</BLOCKQUOTE> +<BLOCKQUOTE STYLE="margin-left: 0cm; margin-right: 0cm">Modified by +Ross Johnson for use with Pthreads-w32.</BLOCKQUOTE> +<H2 STYLE="margin-top: 0cm"><A HREF="#toc6" NAME="sect6">See Also</A></H2> +<BLOCKQUOTE STYLE="margin-left: 0cm; margin-right: 0cm"><A HREF="pthread_exit.html"><B>pthread_exit</B>(3)</A> +, <A HREF="pthread_cancel.html"><B>pthread_cancel</B>(3)</A> , +<A HREF="pthread_cancel.html"><B>pthread_setcanceltype</B>(3)</A> . +</BLOCKQUOTE> +<H2 STYLE="margin-top: 0cm"><A HREF="#toc7" NAME="sect7">Example</A></H2> +<BLOCKQUOTE STYLE="margin-left: 0cm; margin-right: 0cm">Here is how +to lock a mutex <I>mut</I> in such a way that it will be unlocked if +the thread is canceled while <I>mut</I> is locked: +</BLOCKQUOTE> +<PRE>pthread_cleanup_push(pthread_mutex_unlock, (void *) &mut); +pthread_mutex_lock(&mut); +/* do some work */ +pthread_mutex_unlock(&mut); +pthread_cleanup_pop(0);</PRE><BLOCKQUOTE STYLE="margin-left: 0cm; margin-right: 0cm"> +Equivalently, the last two lines can be replaced by +</BLOCKQUOTE> +<PRE STYLE="margin-bottom: 0.5cm">pthread_cleanup_pop(1);</PRE><BLOCKQUOTE STYLE="margin-left: 0cm; margin-right: 0cm"> +Notice that the code above is safe only in deferred cancellation mode +(see <A HREF="pthread_cancel.html"><B>pthread_setcanceltype</B>(3)</A> +). In asynchronous cancellation mode, a cancellation can occur +between <B>pthread_cleanup_push</B> and <B>pthread_mutex_lock</B>, or +between <B>pthread_mutex_unlock</B> and <B>pthread_cleanup_pop</B>, +resulting in both cases in the thread trying to unlock a mutex not +locked by the current thread. This is the main reason why +asynchronous cancellation is difficult to use. +</BLOCKQUOTE> +<BLOCKQUOTE STYLE="margin-left: 0cm; margin-right: 0cm">If the code +above must also work in asynchronous cancellation mode, then it must +switch to deferred mode for locking and unlocking the mutex: +</BLOCKQUOTE> +<PRE>pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype); +pthread_cleanup_push(pthread_mutex_unlock, (void *) &mut); +pthread_mutex_lock(&mut); +/* do some work */ +pthread_cleanup_pop(1); +pthread_setcanceltype(oldtype, NULL);</PRE> +<HR> +<BLOCKQUOTE STYLE="margin-left: 0cm; margin-right: 0cm"><A NAME="toc"></A> +<B>Table of Contents</B></BLOCKQUOTE> +<UL> + <LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Author</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">See + Also</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-right: 0cm"><A HREF="#sect7" NAME="toc7">Example</A> + </BLOCKQUOTE> +</UL> +</BODY> +</HTML>
\ No newline at end of file diff --git a/manual/pthread_cond_init.html b/manual/pthread_cond_init.html new file mode 100644 index 0000000..7386a67 --- /dev/null +++ b/manual/pthread_cond_init.html @@ -0,0 +1,311 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>PTHREAD_COND(3) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050504;16454400"> + <META NAME="CHANGED" CONTENT="20050505;19004700"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_cond_init, pthread_cond_destroy, pthread_cond_signal, +pthread_cond_broadcast, pthread_cond_wait, pthread_cond_timedwait - +operations on conditions +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h></B> +</P> +<P><B>pthread_cond_t </B><I>cond</I> <B>= PTHREAD_COND_INITIALIZER;</B> +</P> +<P><B>int pthread_cond_init(pthread_cond_t *</B><I>cond</I><B>, +pthread_condattr_t *</B><I>cond_attr</I><B>);</B> +</P> +<P><B>int pthread_cond_signal(pthread_cond_t *</B><I>cond</I><B>);</B> +</P> +<P><B>int pthread_cond_broadcast(pthread_cond_t *</B><I>cond</I><B>);</B> +</P> +<P><B>int pthread_cond_wait(pthread_cond_t *</B><I>cond</I><B>, +pthread_mutex_t *</B><I>mutex</I><B>);</B> +</P> +<P><B>int pthread_cond_timedwait(pthread_cond_t *</B><I>cond</I><B>, +pthread_mutex_t *</B><I>mutex</I><B>, const struct timespec +*</B><I>abstime</I><B>);</B> +</P> +<P><B>int pthread_cond_destroy(pthread_cond_t *</B><I>cond</I><B>);</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>A condition (short for ‘‘condition variable’’) is a +synchronization device that allows threads to suspend execution and +relinquish the processors until some predicate on shared data is +satisfied. The basic operations on conditions are: signal the +condition (when the predicate becomes true), and wait for the +condition, suspending the thread execution until another thread +signals the condition. +</P> +<P>A condition variable must always be associated with a mutex, to +avoid the race condition where a thread prepares to wait on a +condition variable and another thread signals the condition just +before the first thread actually waits on it. +</P> +<P><B>pthread_cond_init</B> initializes the condition variable <I>cond</I>, +using the condition attributes specified in <I>cond_attr</I>, or +default attributes if <I>cond_attr</I> is <B>NULL</B>. +</P> +<P>Variables of type <B>pthread_cond_t</B> can also be initialized +statically, using the constant <B>PTHREAD_COND_INITIALIZER</B>. In +the <B>Pthreads-w32</B> implementation, an application should still +call <B>pthread_cond_destroy</B> at some point to ensure that any +resources consumed by the condition variable are released.</P> +<P><B>pthread_cond_signal</B> restarts one of the threads that are +waiting on the condition variable <I>cond</I>. If no threads are +waiting on <I>cond</I>, nothing happens. If several threads are +waiting on <I>cond</I>, exactly one is restarted, but it is not +specified which. +</P> +<P><B>pthread_cond_broadcast</B> restarts all the threads that are +waiting on the condition variable <I>cond</I>. Nothing happens if no +threads are waiting on <I>cond</I>. +</P> +<P><B>pthread_cond_wait</B> atomically unlocks the <I>mutex</I> (as +per <B>pthread_unlock_mutex</B>) and waits for the condition variable +<I>cond</I> to be signalled. The thread execution is suspended and +does not consume any CPU time until the condition variable is +signalled. The <I>mutex</I> must be locked by the calling thread on +entrance to <B>pthread_cond_wait</B>. Before returning to the calling +thread, <B>pthread_cond_wait</B> re-acquires <I>mutex</I> (as per +<B>pthread_lock_mutex</B>). +</P> +<P>Unlocking the mutex and suspending on the condition variable is +done atomically. Thus, if all threads always acquire the mutex before +signalling the condition, this guarantees that the condition cannot +be signalled (and thus ignored) between the time a thread locks the +mutex and the time it waits on the condition variable. +</P> +<P><B>pthread_cond_timedwait</B> atomically unlocks <I>mutex</I> and +waits on <I>cond</I>, as <B>pthread_cond_wait</B> does, but it also +bounds the duration of the wait. If <I>cond</I> has not been +signalled within the amount of time specified by <I>abstime</I>, the +mutex <I>mutex</I> is re-acquired and <B>pthread_cond_timedwait</B> +returns the error <B>ETIMEDOUT</B>. The <I>abstime</I> parameter +specifies an absolute time, with the same origin as <A HREF="time.html"><B>time</B>(2)</A> +and <A HREF="gettimeofday.html"><B>gettimeofday</B>(2)</A>. +</P> +<P><B>pthread_cond_destroy</B> destroys a condition variable, freeing +the resources it might hold. No threads must be waiting on the +condition variable on entrance to <B>pthread_cond_destroy</B>.</P> +<H2><A HREF="#toc3" NAME="sect3">Cancellation</A></H2> +<P><B>pthread_cond_wait</B> and <B>pthread_cond_timedwait</B> are +cancellation points. If a thread is cancelled while suspended in one +of these functions, the thread immediately resumes execution, then +locks again the <I>mutex</I> argument to <B>pthread_cond_wait</B> and +<B>pthread_cond_timedwait</B>, and finally executes the cancellation. +Consequently, cleanup handlers are assured that <I>mutex</I> is +locked when they are called. +</P> +<H2><A HREF="#toc4" NAME="sect4">Async-signal Safety</A></H2> +<P>The condition functions are not async-signal safe, and should not +be called from a signal handler. In particular, calling +<B>pthread_cond_signal</B> or <B>pthread_cond_broadcast</B> from a +signal handler may deadlock the calling thread. +</P> +<H2><A HREF="#toc5" NAME="sect5">Return Value</A></H2> +<P>All condition variable functions return 0 on success and a +non-zero error code on error. +</P> +<H2><A HREF="#toc6" NAME="sect6">Errors</A></H2> +<P><B>pthread_cond_init</B>, <B>pthread_cond_signal</B>, +<B>pthread_cond_broadcast</B>, and <B>pthread_cond_wait</B> never +return an error code. +</P> +<P>The <B>pthread_cond_init</B> function returns the following error +codes on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + The <I>cond</I> argument is invalid. + </DD><DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + <B>ENOMEM</B> + </DT></DL> +</DL> +<BLOCKQUOTE STYLE="margin-left: 4cm"> +There was not enough memory to allocate the condition variable. +</BLOCKQUOTE> +<P>The <B>pthread_cond_signal</B> function returns the following +error codes on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + The <I>cond</I> argument is invalid. + </DD></DL> +</DL> +<P> +The <B>pthread_cond_broadcast</B> function returns the following +error codes on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + The <I>cond</I> argument is invalid. + </DD></DL> +</DL> +<P> +The <B>pthread_cond_wait</B> function returns the following error +codes on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + The <I>cond</I> argument is invalid. + </DD><DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + <B>ENOMEM</B> + </DT></DL> +</DL> +<BLOCKQUOTE STYLE="margin-left: 4cm"> +There was not enough memory to allocate the statically initialised +condition variable. Statically initialised condition variables are +dynamically allocated by the first thread to wait on them.</BLOCKQUOTE> +<P>The <B>pthread_cond_timedwait</B> function returns the following +error codes on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B> + </DT></DL> +</DL> +<P STYLE="margin-left: 2cm"> +The <I>cond</I> argument is invalid. +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ETIMEDOUT</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + The condition variable was not signalled before the timeout + specified by <I>abstime</I> + </DD><DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + <B>ENOMEM</B> + </DT></DL> +</DL> +<BLOCKQUOTE STYLE="margin-left: 4cm"> +There was not enough memory to allocate the statically initialised +condition variable. Statically initialised condition variables are +dynamically allocated by the first thread to wait on them. +</BLOCKQUOTE> +<P>The <B>pthread_cond_destroy</B> function returns the following +error code on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B> + </DT></DL> +</DL> +<P STYLE="margin-left: 2cm; margin-right: 1cm"> +The <I>cond</I> argument is invalid. +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EBUSY</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + Some threads are currently waiting on <I>cond</I>. + </DD></DL> +</DL> +<H2> +<A HREF="#toc7" NAME="sect7">Author</A></H2> +<P>Xavier Leroy <Xavier.Leroy@inria.fr> +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<H2><A HREF="#toc8" NAME="sect8">See Also</A></H2> +<P><A HREF="pthread_condattr_init.html"><B>pthread_condattr_init</B>(3)</A> +, <A HREF="pthread_mutex_lock.html"><B>pthread_mutex_lock</B>(3)</A> +, <A HREF="pthread_mutex_unlock.html"><B>pthread_mutex_unlock</B>(3)</A> +, <A HREF="pthread_cancel.html"><B>pthread_cancel(3)</B></A>. +</P> +<H2><A HREF="#toc9" NAME="sect9">Example</A></H2> +<P>Consider two shared variables <I>x</I> and <I>y</I>, protected by +the mutex <I>mut</I>, and a condition variable <I>cond</I> that is to +be signaled whenever <I>x</I> becomes greater than <I>y</I>. +</P> +<PRE STYLE="margin-left: 1cm; margin-right: 1cm">int x,y; +pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER; +pthread_cond_t cond = PTHREAD_COND_INITIALIZER;</PRE><BLOCKQUOTE> +Waiting until <I>x</I> is greater than <I>y</I> is performed as +follows: +</BLOCKQUOTE> +<PRE STYLE="margin-left: 1.01cm">pthread_mutex_lock(&mut); +while (x <= y) { + pthread_cond_wait(&cond, &mut); +} +/* operate on x and y */ +pthread_mutex_unlock(&mut);</PRE><BLOCKQUOTE STYLE="margin-left: 3.01cm"> +Modifications on <I>x</I> and <I>y</I> that may cause <I>x</I> to +become greater than <I>y</I> should signal the condition if needed: +</BLOCKQUOTE> +<PRE STYLE="margin-left: 1.01cm">pthread_mutex_lock(&mut); +/* modify x and y */ +if (x > y) pthread_cond_broadcast(&cond); +pthread_mutex_unlock(&mut);</PRE><BLOCKQUOTE STYLE="margin-left: 3.01cm"> +If it can be proved that at most one waiting thread needs to be waken +up (for instance, if there are only two threads communicating through +<I>x</I> and <I>y</I>), <B>pthread_cond_signal</B> can be used as a +slightly more efficient alternative to <B>pthread_cond_broadcast</B>. +If in doubt, use <B>pthread_cond_broadcast</B>. +</BLOCKQUOTE> +<BLOCKQUOTE STYLE="margin-left: 3.01cm">To wait for <I>x</I> to +become greater than <I>y</I> with a timeout of 5 seconds, do: +</BLOCKQUOTE> +<PRE STYLE="margin-left: 1.01cm">struct timeval now; +struct timespec timeout; +int retcode; +pthread_mutex_lock(&mut); +gettimeofday(&now); +timeout.tv_sec = now.tv_sec + 5; +timeout.tv_nsec = now.tv_usec * 1000; +retcode = 0; +while (x <= y && retcode != ETIMEDOUT) { + retcode = pthread_cond_timedwait(&cond, &mut, &timeout); +} +if (retcode == ETIMEDOUT) { + /* timeout occurred */ +} else { + /* operate on x and y */ +} +pthread_mutex_unlock(&mut);</PRE> +<HR> +<BLOCKQUOTE STYLE="margin-left: 0cm; margin-right: 0cm"><A NAME="toc"></A> +<B>Table of Contents</B></BLOCKQUOTE> +<UL> + <LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Cancellation</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Async-signal + Safety</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Return + Value</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Errors</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Author</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">See + Also</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-right: 0cm"><A HREF="#sect9" NAME="toc9">Example</A> + </BLOCKQUOTE> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_condattr_init.html b/manual/pthread_condattr_init.html new file mode 100644 index 0000000..0435297 --- /dev/null +++ b/manual/pthread_condattr_init.html @@ -0,0 +1,96 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>PTHREAD_CONDATTR(3) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050504;16375600"> + <META NAME="CHANGED" CONTENT="20050504;16570300"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_condattr_init, pthread_condattr_destroy - condition +creation +</P> +<P>attributes +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h></B> +</P> +<P><B>int pthread_condattr_init(pthread_condattr_t *</B><I>attr</I><B>);</B> +</P> +<P><B>int pthread_condattr_destroy(pthread_condattr_t *</B><I>attr</I><B>);</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>Condition attributes can be specified at condition creation time, +by passing a condition attribute object as second argument to +<A HREF="pthread_cond_init.html"><B>pthread_cond_init</B>(3)</A> . +Passing <B>NULL</B> is equivalent to passing a condition attribute +object with all attributes set to their default values. +</P> +<P><B>pthread_condattr_init</B> initializes the condition attribute +object <I>attr</I> and fills it with default values for the +attributes. <B>pthread_condattr_destroy</B> destroys a condition +attribute object, which must not be reused until it is reinitialized.</P> +<P><B>Pthreads-w32</B> defines _<B>POSIX_THREAD_PROCESS_SHARED</B> in +pthread.h as -1 to indicate that the attribute routines are +implemented but that the process shared attribute is not supported.</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>All condition variable functions return 0 on success and a +non-zero error code on error.</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>The <B>pthread_condattr_init</B> function returns the following +error code on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ENOMEM</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + The was insufficient memory to create the attribute.<SPAN STYLE="font-weight: medium"> + </SPAN> + </DD></DL> +</DL> +<P> +The <B>pthread_condattr_destroy</B> function returns the following +error code on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + The <I>attr</I> argument is not valid.<SPAN STYLE="font-weight: medium"> + </SPAN> + </DD></DL> +</DL> +<H2> +<A HREF="#toc5" NAME="sect5">Author</A></H2> +<P>Xavier Leroy <Xavier.Leroy@inria.fr> +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<H2><A HREF="#toc6" NAME="sect6">See Also</A></H2> +<P><A HREF="pthread_cond_init.html"><B>pthread_cond_init</B>(3)</A> . +</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Author</A> + </P> + <LI><P><A HREF="#sect6" NAME="toc6">See Also</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_condattr_setpshared.html b/manual/pthread_condattr_setpshared.html new file mode 100644 index 0000000..f3bdd38 --- /dev/null +++ b/manual/pthread_condattr_setpshared.html @@ -0,0 +1,151 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>"PTHREAD_CONDATTR_GETPSHARED"(P) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050504;17542300"> + <META NAME="CHANGED" CONTENT="20050505;18293100"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_condattr_getpshared, pthread_condattr_setpshared - get and +set the process-shared condition variable attributes +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h> </B> +</P> +<P><B>int pthread_condattr_getpshared(const pthread_condattr_t +*restrict</B> <I>attr</I><B>, int *restrict</B> <I>pshared</I><B>); +<BR>int pthread_condattr_setpshared(pthread_condattr_t *</B><I>attr</I><B>, +int</B> <I>pshared</I><B>); </B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>The <B>pthread_condattr_getpshared</B> function shall obtain the +value of the <I>process-shared</I> attribute from the attributes +object referenced by <I>attr</I>. The <B>pthread_condattr_setpshared</B> +function shall set the <I>process-shared</I> attribute in an +initialized attributes object referenced by <I>attr</I>. +</P> +<P>The <I>process-shared</I> attribute is set to +<B>PTHREAD_PROCESS_SHARED</B> to permit a condition variable to be +operated upon by any thread that has access to the memory where the +condition variable is allocated, even if the condition variable is +allocated in memory that is shared by multiple processes. If the +<I>process-shared</I> attribute is <B>PTHREAD_PROCESS_PRIVATE</B>, +the condition variable shall only be operated upon by threads created +within the same process as the thread that initialized the condition +variable; if threads of differing processes attempt to operate on +such a condition variable, the behavior is undefined. The default +value of the attribute is <B>PTHREAD_PROCESS_PRIVATE</B>. +</P> +<P><B>Pthreads-w32</B> defines _<B>POSIX_THREAD_PROCESS_SHARED</B> in +pthread.h as -1 to indicate that these routines are implemented but +that the process shared attribute is not supported.</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>If successful, the <B>pthread_condattr_setpshared</B> function +shall return zero; otherwise, an error number shall be returned to +indicate the error. +</P> +<P>If successful, the <B>pthread_condattr_getpshared</B> function +shall return zero and store the value of the <I>process-shared</I> +attribute of <I>attr</I> into the object referenced by the <I>pshared</I> +parameter. Otherwise, an error number shall be returned to indicate +the error. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>The <B>pthread_condattr_getpshared</B> and +<B>pthread_condattr_setpshared</B> functions may fail if: +</P> +<DL> + <DT><B>EINVAL</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The value specified by <I>attr</I> is invalid. + </DD></DL> +<P> +The <B>pthread_condattr_setpshared</B> function may fail if: +</P> +<DL> + <DT><B>EINVAL</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The new value specified for the attribute is outside the range of + legal values for that attribute. + </DD><DT> + <B>ENOSYS</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The value specified by <I>attr</I> was <B>PTHREAD_PROCESS_SHARED</B> + (Pthreads-w32).</DD></DL> +<P> +These functions shall not return an error code of [EINTR]. +</P> +<P><I>The following sections are informative.</I> +</P> +<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2> +<P>None. +</P> +<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2> +<P><B>Pthreads-w32</B> defines <B>_POSIX_THREAD_PROCESS_SHARED</B> in +pthread.h as -1 to indicate that these routines are implemented and +may be used, but do not support the process shared option.</P> +<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2> +<P>None. +</P> +<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2> +<P>None. +</P> +<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2> +<P><A HREF="pthread_create.html"><B>pthread_create</B>(3)</A> <B>,</B> +<A HREF="pthread_cond_init.html"><B>pthread_cond_destroy</B>(3)</A> <B>,</B> +<A HREF="pthread_condattr_init.html"><B>pthread_condattr_destroy</B>(3)</A> +<B>,</B> <A HREF="pthread_mutex_init.html"><B>pthread_mutex_destroy</B>(3)</A> +<B>,</B> the Base Definitions volume of IEEE Std 1003.1-2001, +<I><pthread.h></I> +</P> +<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2> +<P>Portions of this text are reprinted and reproduced in electronic +form from IEEE Std 1003.1, 2003 Edition, Standard for Information +Technology -- Portable Operating System Interface (POSIX), The Open +Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the +Institute of Electrical and Electronics Engineers, Inc and The Open +Group. In the event of any discrepancy between this version and the +original IEEE and The Open Group Standard, the original IEEE and The +Open Group Standard is the referee document. The original Standard +can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A> +. +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application + Usage</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future + Directions</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See + Also</A> + </P> + <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_create.html b/manual/pthread_create.html new file mode 100644 index 0000000..9f7c465 --- /dev/null +++ b/manual/pthread_create.html @@ -0,0 +1,92 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>PTHREAD_CREATE(3) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050504;19394700"> + <META NAME="CHANGED" CONTENT="20050504;20140200"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_create - create a new thread +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h></B> +</P> +<P><B>int pthread_create(pthread_t * </B><I>thread</I><B>, +pthread_attr_t * </B><I>attr</I><B>, void * (*</B><I>start_routine</I><B>)(void +*), void * </B><I>arg</I><B>);</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P><B>pthread_create</B> creates a new thread of control that +executes concurrently with the calling thread. The new thread applies +the function <I>start_routine</I> passing it <I>arg</I> as first +argument. The new thread terminates either explicitly, by calling +<A HREF="pthread_exit.html"><B>pthread_exit</B>(3)</A> , or +implicitly, by returning from the <I>start_routine</I> function. The +latter case is equivalent to calling <A HREF="pthread_exit.html"><B>pthread_exit</B>(3)</A> +with the result returned by <I>start_routine</I> as exit code. +</P> +<P>The initial signal state of the new thread is inherited from it's +creating thread and there are no pending signals. <B>Pthreads-w32</B> +does not yet implement signals.</P> +<P>The <I>attr</I> argument specifies thread attributes to be applied +to the new thread. See <A HREF="pthread_attr_init.html"><B>pthread_attr_init</B>(3)</A> +for a complete list of thread attributes. The <I>attr</I> argument +can also be <B>NULL</B>, in which case default attributes are used: +the created thread is joinable (not detached) and has default (non +real-time) scheduling policy. +</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>On success, the identifier of the newly created thread is stored +in the location pointed by the <I>thread</I> argument, and a 0 is +returned. On error, a non-zero error code is returned. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<DL> + <DT><B>EAGAIN</B> + </DT><DL> + <DL> + <DT> + Not enough system resources to create a process for the new + thread, or<BR>more than <B>PTHREAD_THREADS_MAX</B> threads are + already active. + </DT></DL> + </DL> +</DL> +<H2> +<A HREF="#toc5" NAME="sect5">Author</A></H2> +<P>Xavier Leroy <Xavier.Leroy@inria.fr> +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<H2><A HREF="#toc6" NAME="sect6">See Also</A></H2> +<P><A HREF="pthread_exit.html"><B>pthread_exit</B>(3)</A> , +<A HREF="pthread_join.html"><B>pthread_join</B>(3)</A> , +<A HREF="pthread_detach.html"><B>pthread_detach</B>(3)</A> , +<A HREF="pthread_attr_init.html"><B>pthread_attr_init</B>(3)</A> . +</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Author</A> + </P> + <LI><P><A HREF="#sect6" NAME="toc6">See Also</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_delay_np.html b/manual/pthread_delay_np.html new file mode 100644 index 0000000..6325c3a --- /dev/null +++ b/manual/pthread_delay_np.html @@ -0,0 +1,69 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>PTHREAD_DELAY_NP manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;322600"> + <META NAME="CHANGED" CONTENT="20050505;21371500"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P STYLE="font-weight: medium">pthread_delay_np – suspend the +thread for a specified period</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h></B> +</P> +<P><B>int pthread_delay_np (const struct timespec *</B>interval<B>);</B></P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P><B>pthread_delay_np</B> causes a thread to delay execution for a +specific period of time. This period ends at the current time plus +the specified interval. The routine will not return before the end of +the period is reached, but may return an arbitrary amount of time +after the period has gone by. This can be due to system load, thread +priorities, and system timer granularity.</P> +<P>Specifying an interval of zero (0) seconds and zero (0) +nanoseconds is allowed and can be used to force the thread to give up +the processor or to deliver a pending cancellation request.</P> +<H2><A HREF="#toc3" NAME="sect3">Cancellation</A></H2> +<P><B>pthread_delay_np </B>is a cancellation point.</P> +<H2><A HREF="#toc4" NAME="sect4">Return Value</A></H2> +<P>If an error condition occurs, <B>pthread_delay_np</B> returns an +integer value indicating the type of error.</P> +<H2><A HREF="#toc5" NAME="sect5">Errors</A></H2> +<P>The <B>pthread_delay_np</B> function returns the following error +code on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B> + </DT></DL> +</DL> +<P STYLE="margin-left: 2cm"> +The value specified by interval is invalid.</P> +<H2><A HREF="#toc6" NAME="sect6">Author</A></H2> +<P>Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Cancellation</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Errors</A> + </P> + <LI><P><A HREF="#sect6" NAME="toc6">Author</A> + </P> +</UL> +</BODY> +</HTML>
\ No newline at end of file diff --git a/manual/pthread_detach.html b/manual/pthread_detach.html new file mode 100644 index 0000000..e5b668b --- /dev/null +++ b/manual/pthread_detach.html @@ -0,0 +1,84 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>PTHREAD_DETACH(3) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050504;18010700"> + <META NAME="CHANGED" CONTENT="20050504;18032100"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_detach - put a running thread in the detached state +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h></B> +</P> +<P><B>int pthread_detach(pthread_t </B><I>th</I><B>);</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P><B>pthread_detach</B> puts the thread <I>th</I> in the detached +state. This guarantees that the memory resources consumed by <I>th</I> +will be freed immediately when <I>th</I> terminates. However, this +prevents other threads from synchronizing on the termination of <I>th</I> +using <B>pthread_join</B>. +</P> +<P>A thread can be created initially in the detached state, using the +<B>detachstate</B> attribute to <A HREF="pthread_create.html"><B>pthread_create</B>(3)</A> +. In contrast, <B>pthread_detach</B> applies to threads created in +the joinable state, and which need to be put in the detached state +later. +</P> +<P>After <B>pthread_detach</B> completes, subsequent attempts to +perform <B>pthread_join</B> on <I>th</I> will fail. If another thread +is already joining the thread <I>th</I> at the time <B>pthread_detach</B> +is called, <B>pthread_detach</B> does nothing and leaves <I>th</I> in +the joinable state. +</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>On success, 0 is returned. On error, a non-zero error code is +returned. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<DL> + <DT><B>ESRCH</B> + </DT><DD> + No thread could be found corresponding to that specified by <I>th</I> + </DD><DT> + <B>EINVAL</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + the thread <I>th</I> is already in the detached state + </DD></DL> +<H2> +<A HREF="#toc5" NAME="sect5">Author</A></H2> +<P>Xavier Leroy <Xavier.Leroy@inria.fr> +</P> +<H2><A HREF="#toc6" NAME="sect6">See Also</A></H2> +<P><A HREF="pthread_create.html"><B>pthread_create</B>(3)</A> , +<A HREF="pthread_join.html"><B>pthread_join</B>(3)</A> , +<A HREF="pthread_attr_setdetachstate.html"><B>pthread_attr_setdetachstate</B>(3)</A> +</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Author</A> + </P> + <LI><P><A HREF="#sect6" NAME="toc6">See Also</A> + </P> +</UL> +</BODY> +</HTML>
\ No newline at end of file diff --git a/manual/pthread_equal.html b/manual/pthread_equal.html new file mode 100644 index 0000000..6f61063 --- /dev/null +++ b/manual/pthread_equal.html @@ -0,0 +1,48 @@ +<!-- manual page source format generated by PolyglotMan v3.2, --> +<!-- available at http://polyglotman.sourceforge.net/ --> + +<html> +<head> +<title>PTHREAD_EQUAL(3) manual page</title> +</head> +<body bgcolor='white'> +<a href='#toc'>Table of Contents</a><p> + +<p> +<h2><a name='sect0' href='#toc0'>Name</a></h2> +pthread_equal - compare two thread identifiers +<p> +<h2><a name='sect1' href='#toc1'>Synopsis</a></h2> +<b>#include <pthread.h></b> + +<p> <b>int pthread_equal(pthread_t </b><i>thread1</i><b>, pthread_t </b><i>thread2</i><b>);</b> +<p> +<h2><a name='sect2' href='#toc2'>Description</a></h2> +<b>pthread_equal</b> +determines if two thread identifiers refer to the same thread. +<p> +<h2><a name='sect3' href='#toc3'>Return Value</a></h2> +A +non-zero value is returned if <i>thread1</i> and <i>thread2</i> refer to the same thread. +Otherwise, 0 is returned. +<p> +<h2><a name='sect4' href='#toc4'>Author</a></h2> +Xavier Leroy <Xavier.Leroy@inria.fr> +<p> +<h2><a name='sect5' href='#toc5'>See Also</a></h2> +<a href='file:pthread_self.html'><b>pthread_self</b>(3)</a> +. +<p> + +<hr><p> +<a name='toc'><b>Table of Contents</b></a><p> +<ul> +<li><a name='toc0' href='#sect0'>Name</a></li> +<li><a name='toc1' href='#sect1'>Synopsis</a></li> +<li><a name='toc2' href='#sect2'>Description</a></li> +<li><a name='toc3' href='#sect3'>Return Value</a></li> +<li><a name='toc4' href='#sect4'>Author</a></li> +<li><a name='toc5' href='#sect5'>See Also</a></li> +</ul> +</body> +</html> diff --git a/manual/pthread_exit.html b/manual/pthread_exit.html new file mode 100644 index 0000000..e97318f --- /dev/null +++ b/manual/pthread_exit.html @@ -0,0 +1,59 @@ +<!-- manual page source format generated by PolyglotMan v3.2, --> +<!-- available at http://polyglotman.sourceforge.net/ --> + +<html> +<head> +<title>PTHREAD_EXIT(3) manual page</title> +</head> +<body bgcolor='white'> +<a href='#toc'>Table of Contents</a><p> + +<p> +<h2><a name='sect0' href='#toc0'>Name</a></h2> +pthread_exit - terminate the calling thread +<p> +<h2><a name='sect1' href='#toc1'>Synopsis</a></h2> +<b>#include <pthread.h></b> + +<p> <b>void pthread_exit(void *</b><i>retval</i><b>);</b> +<p> +<h2><a name='sect2' href='#toc2'>Description</a></h2> +<b>pthread_exit</b> terminates the +execution of the calling thread. All cleanup handlers that have been set +for the calling thread with <a href='file:pthread_cleanup_push.html'><b>pthread_cleanup_push</b>(3)</a> + are executed in reverse +order (the most recently pushed handler is executed first). Finalization +functions for thread-specific data are then called for all keys that have +non- <b>NULL</b> values associated with them in the calling thread (see <a href='file:pthread_key_create.html'><b>pthread_key_create</b>(3)</a> +). +Finally, execution of the calling thread is stopped. +<p> The <i>retval</i> argument +is the return value of the thread. It can be consulted from another thread +using <a href='file:pthread_join.html'><b>pthread_join</b>(3)</a> +. +<p> +<h2><a name='sect3' href='#toc3'>Return Value</a></h2> +The <b>pthread_exit</b> function never returns. + +<p> +<h2><a name='sect4' href='#toc4'>Author</a></h2> +Xavier Leroy <Xavier.Leroy@inria.fr> +<p> +<h2><a name='sect5' href='#toc5'>See Also</a></h2> +<a href='file:pthread_create.html'><b>pthread_create</b>(3)</a> +, <a href='file:pthread_join.html'><b>pthread_join</b>(3)</a> +. +<p> + +<hr><p> +<a name='toc'><b>Table of Contents</b></a><p> +<ul> +<li><a name='toc0' href='#sect0'>Name</a></li> +<li><a name='toc1' href='#sect1'>Synopsis</a></li> +<li><a name='toc2' href='#sect2'>Description</a></li> +<li><a name='toc3' href='#sect3'>Return Value</a></li> +<li><a name='toc4' href='#sect4'>Author</a></li> +<li><a name='toc5' href='#sect5'>See Also</a></li> +</ul> +</body> +</html> diff --git a/manual/pthread_getw32threadhandle_np.html b/manual/pthread_getw32threadhandle_np.html new file mode 100644 index 0000000..0f028bf --- /dev/null +++ b/manual/pthread_getw32threadhandle_np.html @@ -0,0 +1,55 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>PTHREAD_GETW32THREADHANDLE_NP manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;322600"> + <META NAME="CHANGED" CONTENT="20050505;21523500"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P STYLE="font-weight: medium">pthread_getw32threadhandle_np – get +the Win32 thread handle associated with a thread</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h></B> +</P> +<P><B>HANDLE pthread_getw32threadhandle_np(pthread_t</B> <I>thread</I><B>);</B></P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>Returns the Win32 native thread <B>HANDLE</B> that the POSIX +thread <I>thread</I> is running as.</P> +<P>Applications can use the Win32 handle to set Win32 specific +attributes of the thread.</P> +<H2><A HREF="#toc3" NAME="sect3">Cancellation</A></H2> +<P>None.</P> +<H2><A HREF="#toc4" NAME="sect4">Return Value</A></H2> +<P><B>pthread_getw32threadhandle_np</B> returns the Win32 native +thread <B>HANDLE</B> for the specified POSIX thread <I>thread</I>.</P> +<H2><A HREF="#toc5" NAME="sect5">Errors</A></H2> +<P>None.</P> +<H2><A HREF="#toc6" NAME="sect6">Author</A></H2> +<P>Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Cancellation</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Errors</A> + </P> + <LI><P><A HREF="#sect6" NAME="toc6">Author</A> + </P> +</UL> +</BODY> +</HTML>
\ No newline at end of file diff --git a/manual/pthread_join.html b/manual/pthread_join.html new file mode 100644 index 0000000..82bcd27 --- /dev/null +++ b/manual/pthread_join.html @@ -0,0 +1,116 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>PTHREAD_JOIN(3) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050504;18232700"> + <META NAME="CHANGED" CONTENT="20050504;18421400"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_join - wait for termination of another thread +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h></B> +</P> +<P><B>int pthread_join(pthread_t </B><I>th</I><B>, void +**</B><I>thread_return</I><B>);</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P><B>pthread_join</B> suspends the execution of the calling thread +until the thread identified by <I>th</I> terminates, either by +calling <A HREF="pthread_exit.html"><B>pthread_exit</B>(3)</A> or by +being cancelled. +</P> +<P>If <I>thread_return</I> is not <B>NULL</B>, the return value of <I>th</I> +is stored in the location pointed to by <I>thread_return</I>. The +return value of <I>th</I> is either the argument it gave to +<A HREF="pthread_exit.html"><B>pthread_exit</B>(3)</A> , or +<B>PTHREAD_CANCELED</B> if <I>th</I> was cancelled. +</P> +<P>The joined thread <B>th</B> must be in the joinable state: it must +not have been detached using <A HREF="pthread_detach.html"><B>pthread_detach</B>(3)</A> +or the <B>PTHREAD_CREATE_DETACHED</B> attribute to <A HREF="pthread_create.html"><B>pthread_create</B>(3)</A> +. +</P> +<P>When a joinable thread terminates, its memory resources (thread +descriptor and stack) are not deallocated until another thread +performs <B>pthread_join</B> on it. Therefore, <B>pthread_join</B> +must be called once for each joinable thread created to avoid memory +leaks. +</P> +<P>At most one thread can wait for the termination of a given thread. +Calling <B>pthread_join</B> on a thread <I>th</I> on which another +thread is already waiting for termination returns an error. +</P> +<H2><A HREF="#toc3" NAME="sect3">Cancellation</A></H2> +<P><B>pthread_join</B> is a cancellation point. If a thread is +cancelled while suspended in <B>pthread_join</B>, the thread +execution resumes immediately and the cancellation is executed +without waiting for the <I>th</I> thread to terminate. If +cancellation occurs during <B>pthread_join</B>, the <I>th</I> thread +remains not joined. +</P> +<H2><A HREF="#toc4" NAME="sect4">Return Value</A></H2> +<P>On success, the return value of <I>th</I> is stored in the +location pointed to by <I>thread_return</I>, and 0 is returned. On +error, a non-zero error code is returned. +</P> +<H2><A HREF="#toc5" NAME="sect5">Errors</A></H2> +<DL> + <DT><B>ESRCH</B> + </DT><DD> + No thread could be found corresponding to that specified by <I>th</I>. + </DD><DT> + <B>EINVAL</B> + </DT><DD> + The <I>th</I> thread has been detached. + </DD><DT> + <B>EINVAL</B> + </DT><DD> + Another thread is already waiting on termination of <I>th</I>. + </DD><DT> + <B>EDEADLK</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The <I>th</I> argument refers to the calling thread. + </DD></DL> +<H2> +<A HREF="#toc6" NAME="sect6">Author</A></H2> +<P>Xavier Leroy <Xavier.Leroy@inria.fr> +</P> +<H2><A HREF="#toc7" NAME="sect7">See Also</A></H2> +<P><A HREF="pthread_exit.html"><B>pthread_exit</B>(3)</A> , +<A HREF="pthread_detach.html"><B>pthread_detach</B>(3)</A> , +<A HREF="pthread_create.html"><B>pthread_create</B>(3)</A> , +<A HREF="pthread_attr_setdetachstate.html"><B>pthread_attr_setdetachstate</B>(3)</A> +, <A HREF="pthread_cleanup_push.html"><B>pthread_cleanup_push</B>(3)</A> +, <A HREF="pthread_key_create.html"><B>pthread_key_create</B>(3)</A> +. +</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Cancellation</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Author</A> + </P> + <LI><P><A HREF="#sect7" NAME="toc7">See Also</A> + </P> +</UL> +</BODY> +</HTML>
\ No newline at end of file diff --git a/manual/pthread_key_create.html b/manual/pthread_key_create.html new file mode 100644 index 0000000..ed5c48b --- /dev/null +++ b/manual/pthread_key_create.html @@ -0,0 +1,195 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>PTHREAD_SPECIFIC(3) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050504;18425400"> + <META NAME="CHANGED" CONTENT="20050505;18330000"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_key_create, pthread_key_delete, pthread_setspecific, +pthread_getspecific - management of thread-specific data +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h></B> +</P> +<P><B>int pthread_key_create(pthread_key_t *</B><I>key</I><B>, void +(*</B><I>destr_function</I><B>) (void *));</B> +</P> +<P><B>int pthread_key_delete(pthread_key_t </B><I>key</I><B>);</B> +</P> +<P><B>int pthread_setspecific(pthread_key_t </B><I>key</I><B>, const +void *</B><I>pointer</I><B>);</B> +</P> +<P><B>void * pthread_getspecific(pthread_key_t </B><I>key</I><B>);</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>Programs often need global or static variables that have different +values in different threads. Since threads share one memory space, +this cannot be achieved with regular variables. Thread-specific data +is the POSIX threads answer to this need. +</P> +<P>Each thread possesses a private memory block, the thread-specific +data area, or TSD area for short. This area is indexed by TSD keys. +The TSD area associates values of type <B>void *</B> to TSD keys. TSD +keys are common to all threads, but the value associated with a given +TSD key can be different in each thread. +</P> +<P>For concreteness, the TSD areas can be viewed as arrays of <B>void +*</B> pointers, TSD keys as integer indices into these arrays, and +the value of a TSD key as the value of the corresponding array +element in the calling thread. +</P> +<P>When a thread is created, its TSD area initially associates <B>NULL</B> +with all keys. +</P> +<P><B>pthread_key_create</B> allocates a new TSD key. The key is +stored in the location pointed to by <I>key</I>. There is a limit of +<B>PTHREAD_KEYS_MAX</B> on the number of keys allocated at a given +time. The value initially associated with the returned key is <B>NULL</B> +in all currently executing threads. +</P> +<P>The <I>destr_function</I> argument, if not <B>NULL</B>, specifies +a destructor function associated with the key. When a thread +terminates via <B>pthread_exit</B> or by cancellation, <I>destr_function</I> +is called with arguments the value associated with the key in that +thread. The <I>destr_function</I> is not called if that value is +<B>NULL</B>. The order in which destructor functions are called at +thread termination time is unspecified. +</P> +<P>Before the destructor function is called, the <B>NULL</B> value is +associated with the key in the current thread. A destructor function +might, however, re-associate non- <B>NULL</B> values to that key or +some other key. To deal with this, if after all the destructors have +been called for all non- <B>NULL</B> values, there are still some +non- <B>NULL</B> values with associated destructors, then the process +is repeated. The LinuxThreads implementation stops the process after +<B>PTHREAD_DESTRUCTOR_ITERATIONS</B> iterations, even if some non- +<B>NULL</B> values with associated descriptors remain. Other +implementations may loop indefinitely. +</P> +<P><B>pthread_key_delete</B> deallocates a TSD key. It does not check +whether non- <B>NULL</B> values are associated with that key in the +currently executing threads, nor call the destructor function +associated with the key. +</P> +<P><B>pthread_setspecific</B> changes the value associated with <I>key</I> +in the calling thread, storing the given <I>pointer</I> instead. +</P> +<P><B>pthread_getspecific</B> returns the value currently associated +with <I>key</I> in the calling thread. +</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P><B>pthread_key_create</B>, <B>pthread_key_delete</B>, and +<B>pthread_setspecific</B> return 0 on success and a non-zero error +code on failure. If successful, <B>pthread_key_create</B> stores the +newly allocated key in the location pointed to by its <I>key</I> +argument. +</P> +<P><B>pthread_getspecific</B> returns the value associated with <I>key</I> +on success, and <B>NULL</B> on error. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P><B>pthread_key_create</B> returns the following error code on +error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EAGAIN</B> + </DT></DL> +</DL> +<BLOCKQUOTE STYLE="margin-left: 3cm"> +<B>PTHREAD_KEYS_MAX</B> keys are already allocated +</BLOCKQUOTE> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ENOMEM</B> + </DT></DL> +</DL> +<BLOCKQUOTE STYLE="margin-left: 3cm"> +Insufficient memory to allocate the key. +</BLOCKQUOTE> +<P><B>pthread_key_delete</B> and <B>pthread_setspecific</B> return +the following error code on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + <I>key</I> is not a valid, allocated TSD key + </DD></DL> +</DL> +<P> +<B>pthread_getspecific</B> returns <B>NULL</B> if <I>key</I> is not a +valid, allocated TSD key. +</P> +<H2><A HREF="#toc5" NAME="sect5">Author</A></H2> +<P>Xavier Leroy <Xavier.Leroy@inria.fr> +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<H2><A HREF="#toc6" NAME="sect6">See Also</A></H2> +<P><A HREF="pthread_create.html">pthread_create(3)</A> , +<A HREF="pthread_exit.html">pthread_exit(3)</A> , +<A HREF="pthread_cancel.html">pthread_testcancel(3)</A> . +</P> +<H2><A HREF="#toc7" NAME="sect7">Example</A></H2> +<P>The following code fragment allocates a thread-specific array of +100 characters, with automatic reclamation at thread exit: +</P> +<BLOCKQUOTE><BR><BR> +</BLOCKQUOTE> +<PRE STYLE="margin-left: 1cm; margin-right: 1cm">/* Key for the thread-specific buffer */ +static pthread_key_t buffer_key; +/* Once-only initialisation of the key */ +static pthread_once_t buffer_key_once = PTHREAD_ONCE_INIT; +/* Allocate the thread-specific buffer */ +void buffer_alloc(void) +{ + pthread_once(&buffer_key_once, buffer_key_alloc); + pthread_setspecific(buffer_key, malloc(100)); +} +/* Return the thread-specific buffer */ +char * get_buffer(void) +{ + return (char *) pthread_getspecific(buffer_key); +} +/* Allocate the key */ +static void buffer_key_alloc() +{ + pthread_key_create(&buffer_key, buffer_destroy); +} +/* Free the thread-specific buffer */ +static void buffer_destroy(void * buf) +{ + free(buf); +}</PRE> +<HR> +<BLOCKQUOTE STYLE="margin-left: 0cm"><A NAME="toc"></A><B>Table of +Contents</B></BLOCKQUOTE> +<UL> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Author</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">See + Also</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE><A HREF="#sect7" NAME="toc7">Example</A> + </BLOCKQUOTE> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_kill.html b/manual/pthread_kill.html new file mode 100644 index 0000000..6933c8d --- /dev/null +++ b/manual/pthread_kill.html @@ -0,0 +1,150 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>PTHREAD_SIGNAL(3) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050504;18500100"> + <META NAME="CHANGED" CONTENT="20050504;23005800"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_sigmask, pthread_kill, sigwait - handling of signals in +threads +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h></B> <BR><B>#include <signal.h></B> +</P> +<P><B>int pthread_sigmask(int </B><I>how</I><B>, const sigset_t +*</B><I>newmask</I><B>, sigset_t *</B><I>oldmask</I><B>);</B> +</P> +<P><B>int pthread_kill(pthread_t </B><I>thread</I><B>, int </B><I>signo</I><B>);</B> +</P> +<P><B>int sigwait(const sigset_t *</B>set, <B>int</B> *sig);</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P><B>pthread_sigmask</B> changes the signal mask for the calling +thread as described by the <I>how</I> and <I>newmask</I> arguments. +If <I>oldmask</I> is not <B>NULL</B>, the previous signal mask is +stored in the location pointed to by <I>oldmask</I>. <B>Pthreads-w32</B> +implements this function but no other function uses the signal mask +yet.</P> +<P>The meaning of the <I>how</I> and <I>newmask</I> arguments is the +same as for <B><SPAN STYLE="font-style: normal">sigprocmask</SPAN></B>(2). +If <I>how</I> is <B>SIG_SETMASK</B>, the signal mask is set to +<I>newmask</I>. If <I>how</I> is <B>SIG_BLOCK</B>, the signals +specified to <I>newmask</I> are added to the current signal mask. If +<I>how</I> is <B>SIG_UNBLOCK</B>, the signals specified to <I>newmask</I> +are removed from the current signal mask. +</P> +<P>Recall that signal masks are set on a per-thread basis, but signal +actions and signal handlers, as set with <B>sigaction</B>(2), are +shared between all threads. +</P> +<P><B>pthread_kill</B> send signal number <I>signo</I> to the thread +<I>thread</I>. <B>Pthreads-w32</B> only supports signal number 0, +which does not send any signal but causes <B>pthread_kill</B> to +return an error if <I>thread</I> is not valid.</P> +<P><B>sigwait</B> suspends the calling thread until one of the +signals in <I>set</I> is delivered to the calling thread. It then +stores the number of the signal received in the location pointed to +by <I>sig</I> and returns. The signals in <I>set</I> must be blocked +and not ignored on entrance to <B>sigwait</B>. If the delivered +signal has a signal handler function attached, that function is <I>not</I> +called. <B>Pthreads-w32</B> implements this function as a +cancellation point only - it does not wait for any signals and does +not change the location pointed to by <I>sig</I>.</P> +<H2><A HREF="#toc3" NAME="sect3">Cancellation</A></H2> +<P><B>sigwait</B> is a cancellation point. +</P> +<H2><A HREF="#toc4" NAME="sect4">Return Value</A></H2> +<P>On success, 0 is returned. On failure, a non-zero error code is +returned. +</P> +<H2><A HREF="#toc5" NAME="sect5">Errors</A></H2> +<P>The <B>pthread_sigmask</B> function returns the following error +codes on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + <I>how</I> is not one of <B>SIG_SETMASK</B>, <B>SIG_BLOCK</B>, or + <B>SIG_UNBLOCK</B> + </DD></DL> +</DL> +<P> +The <B>pthread_kill</B> function returns the following error codes on +error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + <I>signo</I> is not a valid signal number or is unsupported.</DD><DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + <B>ESRCH</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + the thread <I>thread</I> does not exist (e.g. it has already + terminated) + </DD></DL> +</DL> +<P> +The <B>sigwait</B> function never returns an error. +</P> +<H2><A HREF="#toc6" NAME="sect6">Author</A></H2> +<P>Xavier Leroy <Xavier.Leroy@inria.fr> +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<H2><A HREF="#toc7" NAME="sect7">See Also</A></H2> +<P> +</P> +<H2><A HREF="#toc8" NAME="sect8">Notes</A></H2> +<P>In any implementation, for <B>sigwait</B> to work reliably, the +signals being waited for must be blocked in all threads, not only in +the calling thread, since otherwise the POSIX semantics for signal +delivery do not guarantee that it’s the thread doing the <B>sigwait</B> +that will receive the signal. The best way to achieve this is to +block those signals before any threads are created, and never unblock +them in the program other than by calling <B>sigwait</B>. This works +because all threads inherit their initial sigmask from their creating +thread.</P> +<H2><A HREF="#toc9" NAME="sect9">Bugs</A></H2> +<P><B>Pthreads-w32</B> does not implement signals yet and so these +routines have almost no use except to prevent the compiler or linker +from complaining. <B>pthread_kill</B> is useful in determining if the +thread is a valid thread, but since many threads implementations +reuse thread IDs, the valid thread may no longer be the thread you +think it is, and so this method of determining thread validity is not +portable, and very risky. <B>Pthreads-w32</B> from version 1.0.0 +onwards implements pseudo-unique thread IDs, so applications that use +this technique (but really shouldn't) have some protection.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Cancellation</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Author</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">See + Also</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Notes</A> + </P> + <LI><P><A HREF="#sect9" NAME="toc9">Bugs</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_mutex_init.html b/manual/pthread_mutex_init.html new file mode 100644 index 0000000..a56f77d --- /dev/null +++ b/manual/pthread_mutex_init.html @@ -0,0 +1,275 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>PTHREAD_MUTEX(3) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;5000"> + <META NAME="CHANGED" CONTENT="20050505;19000600"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_mutex_init, pthread_mutex_lock, pthread_mutex_trylock, +pthread_mutex_timedlock, pthread_mutex_unlock, pthread_mutex_destroy +- operations on mutexes +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h></B> +</P> +<P><B>#include <time.h></B></P> +<P><B>pthread_mutex_t </B><I>fastmutex</I> <B>= +PTHREAD_MUTEX_INITIALIZER;</B> +</P> +<P><B>pthread_mutex_t </B><I>recmutex</I> <B>= +PTHREAD_RECURSIVE_MUTEX_INITIALIZER;</B> +</P> +<P><B>pthread_mutex_t </B><I>errchkmutex</I> <B>= +PTHREAD_ERRORCHECK_MUTEX_INITIALIZER;</B> +</P> +<P><B>pthread_mutex_t </B><I>recmutex</I> <B>= +PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;</B> +</P> +<P><B>pthread_mutex_t </B><I>errchkmutex</I> <B>= +PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;</B> +</P> +<P><B>int pthread_mutex_init(pthread_mutex_t *</B><I>mutex</I><B>, +const pthread_mutexattr_t *</B><I>mutexattr</I><B>);</B> +</P> +<P><B>int pthread_mutex_lock(pthread_mutex_t *</B><I>mutex</I><B>);</B> +</P> +<P><B>int pthread_mutex_trylock(pthread_mutex_t *</B><I>mutex</I><B>);</B> +</P> +<P><B>int pthread_mutex_timedlock(pthread_mutex_t *</B><I>mutex, +</I><B>const struct timespec *</B><I>abs_timeout</I><B>);</B> +</P> +<P><B>int pthread_mutex_unlock(pthread_mutex_t *</B><I>mutex</I><B>);</B> +</P> +<P><B>int pthread_mutex_destroy(pthread_mutex_t *</B><I>mutex</I><B>);</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>A mutex is a MUTual EXclusion device, and is useful for protecting +shared data structures from concurrent modifications, and +implementing critical sections and monitors. +</P> +<P>A mutex has two possible states: unlocked (not owned by any +thread), and locked (owned by one thread). A mutex can never be owned +by two different threads simultaneously. A thread attempting to lock +a mutex that is already locked by another thread is suspended until +the owning thread unlocks the mutex first. +</P> +<P><B>pthread_mutex_init</B> initializes the mutex object pointed to +by <I>mutex</I> according to the mutex attributes specified in +<I>mutexattr</I>. If <I>mutexattr</I> is <B>NULL</B>, default +attributes are used instead. +</P> +<P>The type of a mutex determines whether it can be locked again by a +thread that already owns it. The default type is “normal”. See +<A HREF="pthread_mutexattr_init.html"><B>pthread_mutexattr_init</B>(3)</A> +for more information on mutex attributes. +</P> +<P>Variables of type <B>pthread_mutex_t</B> can also be initialized +statically, using the constants <B>PTHREAD_MUTEX_INITIALIZER</B> (for +normal “fast” mutexes), <B>PTHREAD_RECURSIVE_MUTEX_INITIALIZER</B> +(for recursive mutexes), and <B>PTHREAD_ERRORCHECK_MUTEX_INITIALIZER</B> +(for error checking mutexes). <SPAN STYLE="font-weight: medium"> In +the <B>Pthreads-w32</B> implementation, an application should still +call <B>pthread_mutex_destroy</B> at some point to ensure that any +resources consumed by the mutex are released.</SPAN></P> +<P><B>pthread_mutex_lock</B> locks the given mutex. If the mutex is +currently unlocked, it becomes locked and owned by the calling +thread, and <B>pthread_mutex_lock</B> returns immediately. If the +mutex is already locked by another thread, <B>pthread_mutex_lock</B> +suspends the calling thread until the mutex is unlocked. +</P> +<P>If the mutex is already locked by the calling thread, the behavior +of <B>pthread_mutex_lock</B> depends on the type of the mutex. If the +mutex is of the “normal” type, the calling thread is suspended +until the mutex is unlocked, thus effectively causing the calling +thread to deadlock. If the mutex is of the ‘‘error checking’’ +type, <B>pthread_mutex_lock</B> returns immediately with the error +code <B>EDEADLK</B>. If the mutex is of the ‘‘recursive’’ +type, <B>pthread_mutex_lock</B> succeeds and returns immediately, +recording the number of times the calling thread has locked the +mutex. An equal number of <B>pthread_mutex_unlock</B> operations must +be performed before the mutex returns to the unlocked state. +</P> +<P><B>pthread_mutex_trylock</B> behaves identically to +<B>pthread_mutex_lock</B>, except that it does not block the calling +thread if the mutex is already locked by another thread (or by the +calling thread in the case of a “normal” mutex). Instead, +<B>pthread_mutex_trylock</B> returns immediately with the error code +<B>EBUSY</B>. +</P> +<P><B>pthread_mutex_timedlock</B> behaves identically to +<B>pthread_mutex_lock</B>, except that if it cannot acquire the lock +before the <I>abs_timeout</I> time, the call returns with the error +code <B>ETIMEDOUT</B>. If the mutex can be locked immediately it is, +and the <B>abs_timeout</B> parameter is ignored.</P> +<P><B>pthread_mutex_unlock</B> unlocks the given mutex. The mutex is +assumed to be locked and owned by the calling thread on entrance to +<B>pthread_mutex_unlock</B>. If the mutex is of the “normal” +type, <B>pthread_mutex_unlock</B> always returns it to the unlocked +state. If it is of the ‘‘recursive’’ type, it decrements the +locking count of the mutex (number of <B>pthread_mutex_lock</B> +operations performed on it by the calling thread), and only when this +count reaches zero is the mutex actually unlocked. +</P> +<P>On ‘‘error checking’’ mutexes, <B>pthread_mutex_unlock</B> +actually checks at run-time that the mutex is locked on entrance, and +that it was locked by the same thread that is now calling +<B>pthread_mutex_unlock</B>. If these conditions are not met, an +error code is returned and the mutex remains unchanged. ‘‘Normal’’ +mutexes perform no such checks, thus allowing a locked mutex to be +unlocked by a thread other than its owner. This is non-portable +behavior and is not meant to be used as a feature.</P> +<P><B>pthread_mutex_destroy</B> destroys a mutex object, freeing the +resources it might hold. The mutex must be unlocked on entrance.</P> +<H2><A HREF="#toc3" NAME="sect3">Cancellation</A></H2> +<P>None of the mutex functions is a cancellation point, not even +<B>pthread_mutex_lock</B>, in spite of the fact that it can suspend a +thread for arbitrary durations. This way, the status of mutexes at +cancellation points is predictable, allowing cancellation handlers to +unlock precisely those mutexes that need to be unlocked before the +thread stops executing. Consequently, threads using deferred +cancellation should never hold a mutex for extended periods of time. +</P> +<H2><A HREF="#toc4" NAME="sect4">Async-signal Safety</A></H2> +<P>The mutex functions are not async-signal safe. What this means is +that they should not be called from a signal handler. In particular, +calling <B>pthread_mutex_lock</B> or <B>pthread_mutex_unlock</B> from +a signal handler may deadlock the calling thread. +</P> +<H2><A HREF="#toc5" NAME="sect5">Return Value</A></H2> +<P><B>pthread_mutex_init</B> always returns 0. The other mutex +functions return 0 on success and a non-zero error code on error. +</P> +<H2><A HREF="#toc6" NAME="sect6">Errors</A></H2> +<P>The <B>pthread_mutex_lock</B> function returns the following error +code on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + the mutex has not been properly initialized. + </DD><DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + <B>EDEADLK</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + the mutex is already locked by the calling thread (‘‘error + checking’’ mutexes only). + </DD></DL> +</DL> +<P> +The <B>pthread_mutex_trylock</B> function returns the following error +codes on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EBUSY</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + the mutex could not be acquired because it was currently locked. + </DD><DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + <B>EINVAL</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + the mutex has not been properly initialized. + </DD></DL> +</DL> +<P> +The <B>pthread_mutex_timedlock</B> function returns the following +error codes on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ETIMEDOUT</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + the mutex could not be acquired before the <I>abs_timeout</I> time + arrived. + </DD><DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + <B>EINVAL</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + the mutex has not been properly initialized. + </DD></DL> +</DL> +<P> +The <B>pthread_mutex_unlock</B> function returns the following error +code on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + the mutex has not been properly initialized. + </DD><DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + <B>EPERM</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + the calling thread does not own the mutex (‘‘error checking’’ + mutexes only). + </DD></DL> +</DL> +<P> +The <B>pthread_mutex_destroy</B> function returns the following error +code on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EBUSY</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + the mutex is currently locked. + </DD></DL> +</DL> +<H2> +<A HREF="#toc7" NAME="sect7">Author</A></H2> +<P>Xavier Leroy <Xavier.Leroy@inria.fr> +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<H2><A HREF="#toc8" NAME="sect8">See Also</A></H2> +<P><A HREF="pthread_mutexattr_init.html"><B>pthread_mutexattr_init</B>(3)</A> +, <A HREF="pthread_mutexattr_init.html"><B>pthread_mutexattr_settype</B>(3)</A> +, <A HREF="pthread_cancel.html"><B>pthread_cancel</B>(3)</A> . +</P> +<H2><A HREF="#toc9" NAME="sect9">Example</A></H2> +<P>A shared global variable <I>x</I> can be protected by a mutex as +follows: +</P> +<PRE STYLE="margin-left: 1cm; margin-right: 1cm">int x; +pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER;</PRE><BLOCKQUOTE STYLE="margin-left: 0cm; margin-right: 0cm"> +All accesses and modifications to <I>x</I> should be bracketed by +calls to <B>pthread_mutex_lock</B> and <B>pthread_mutex_unlock</B> as +follows: +</BLOCKQUOTE> +<PRE STYLE="margin-left: 1.03cm; margin-right: 2cm">pthread_mutex_lock(&mut); +/* operate on x */ +pthread_mutex_unlock(&mut);</PRE> +<HR> +<BLOCKQUOTE STYLE="margin-right: 4cm"><A NAME="toc"></A><B>Table of +Contents</B></BLOCKQUOTE> +<UL> + <LI><BLOCKQUOTE STYLE="margin-right: 4cm; margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-right: 4cm; margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-right: 4cm; margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-right: 4cm; margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Cancellation</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-right: 4cm; margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Async-signal + Safety</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-right: 4cm; margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Return + Value</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-right: 4cm; margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Errors</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-right: 4cm; margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Author</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-right: 4cm; margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">See + Also</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-right: 4cm"><A HREF="#sect9" NAME="toc9">Example</A> + </BLOCKQUOTE> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_mutexattr_init.html b/manual/pthread_mutexattr_init.html new file mode 100644 index 0000000..3ab5a09 --- /dev/null +++ b/manual/pthread_mutexattr_init.html @@ -0,0 +1,155 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>PTHREAD_MUTEXATTR(3) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050504;23040500"> + <META NAME="CHANGED" CONTENT="20050505;18370400"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_mutexattr_init, pthread_mutexattr_destroy, +pthread_mutexattr_settype, pthread_mutexattr_gettype - mutex creation +attributes +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h></B> +</P> +<P><B>int pthread_mutexattr_init(pthread_mutexattr_t *</B><I>attr</I><B>);</B> +</P> +<P><B>int pthread_mutexattr_destroy(pthread_mutexattr_t *</B><I>attr</I><B>);</B> +</P> +<P><B>int pthread_mutexattr_settype(pthread_mutexattr_t *</B><I>attr</I><B>, +int </B><I>type</I><B>);</B> +</P> +<P><B>int pthread_mutexattr_gettype(const pthread_mutexattr_t *</B><I>attr</I><B>, +int *</B><I>type</I><B>);</B> +</P> +<P><B>int pthread_mutexattr_setkind_np(pthread_mutexattr_t *</B><I>attr</I><B>, +int </B><I>type</I><B>);</B> +</P> +<P><B>int pthread_mutexattr_getkind_np(const pthread_mutexattr_t +*</B><I>attr</I><B>, int *</B><I>type</I><B>);</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>Mutex attributes can be specified at mutex creation time, by +passing a mutex attribute object as second argument to +<A HREF="pthread_mutex_init.html"><B>pthread_mutex_init</B>(3)</A> . +Passing <B>NULL</B> is equivalent to passing a mutex attribute object +with all attributes set to their default values. +</P> +<P><B>pthread_mutexattr_init</B> initializes the mutex attribute +object <I>attr</I> and fills it with default values for the +attributes. +</P> +<P><B>pthread_mutexattr_destroy</B> destroys a mutex attribute +object, which must not be reused until it is reinitialized.</P> +<P>The following mutex types are supported:</P> +<P STYLE="margin-left: 2cm"><B>PTHREAD_MUTEX_NORMAL</B> - for +‘‘fast’’ mutexes.</P> +<P STYLE="margin-left: 2cm"><B>PTHREAD_MUTEX_RECURSIVE</B> - for +‘‘recursive’’ mutexes.</P> +<P STYLE="margin-left: 2cm"><B>PTHREAD_MUTEX_ERRORCHECK</B> - for +‘‘error checking’’ mutexes.</P> +<P>The mutex type determines what happens if a thread attempts to +lock a mutex it already owns with <A HREF="pthread_mutex_lock.html"><B>pthread_mutex_lock</B>(3)</A> +. If the mutex is of the “normal” or “fast” type, +<A HREF="pthread_mutex_lock.html"><B>pthread_mutex_lock</B>(3)</A> +simply suspends the calling thread forever. If the mutex is of the +‘‘error checking’’ type, <A HREF="pthread_mutex_lock.html"><B>pthread_mutex_lock</B>(3)</A> +returns immediately with the error code <B>EDEADLK</B>. If the mutex +is of the ‘‘recursive’’ type, the call to +<A HREF="pthread_mutex_lock.html"><B>pthread_mutex_lock</B>(3)</A> +returns immediately with a success return code. The number of times +the thread owning the mutex has locked it is recorded in the mutex. +The owning thread must call <A HREF="pthread_mutex_unlock.html"><B>pthread_mutex_unlock</B>(3)</A> +the same number of times before the mutex returns to the unlocked +state. +</P> +<P>The default mutex type is <B>PTHREAD_MUTEX_NORMAL</B></P> +<P><B>Pthreads-w32</B> also recognises the following equivalent types +that are used by Linux:</P> +<P STYLE="margin-left: 2cm; font-weight: medium"><B>PTHREAD_MUTEX_FAST_NP</B> +– equivalent to <B>PTHREAD_MUTEX_NORMAL</B></P> +<P STYLE="margin-left: 2cm"><B>PTHREAD_MUTEX_RECURSIVE_NP</B></P> +<P STYLE="margin-left: 2cm"><B>PTHREAD_MUTEX_ERRORCHECK_NP</B></P> +<P><B>pthread_mutexattr_settype</B> sets the mutex type attribute in +<I>attr</I> to the value specified by <I>type</I>. +</P> +<P><B>pthread_mutexattr_gettype</B> retrieves the current value of +the mutex kind attribute in <I>attr</I> and stores it in the location +pointed to by <I>type</I>. +</P> +<P><B>Pthreads-w32</B> also recognises the following equivalent +functions that are used in Linux:</P> +<P><B>pthread_mutexattr_setkind_np</B> is an alias for +<B>pthread_mutexattr_settype</B>. +</P> +<P STYLE="font-weight: medium"><B>pthread_mutexattr_getkind_np</B> is +an alias for <B>pthread_mutexattr_gettype</B>. +</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P><B>pthread_mutexattr_init</B>, <B>pthread_mutexattr_destroy</B> +and <B>pthread_mutexattr_gettype</B> always return 0. +</P> +<P><B>pthread_mutexattr_settype</B> returns 0 on success and a +non-zero error code on error. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>On error, <B>pthread_mutexattr_settype</B> returns the following +error code: +</P> +<DL> + <DT><B>EINVAL</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + <I>type</I> is none of:<BR><B>PTHREAD_MUTEX_NORMAL</B>, + <B>PTHREAD_MUTEX_FAST_NP</B>,<BR><B>PTHREAD_MUTEX_RECURSIVE</B>, + <B>PTHREAD_MUTEX_RECURSIVE_NP,<BR>PTHREAD_MUTEX_ERRORCHECK</B>, + <B>PTHREAD_MUTEX_ERRORCHECK_NP</B> + </DD></DL> +<H2> +<A HREF="#toc5" NAME="sect5">Author</A></H2> +<P>Xavier Leroy <Xavier.Leroy@inria.fr> +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<H2><A HREF="#toc6" NAME="sect6">See Also</A></H2> +<P><A HREF="pthread_mutex_init.html"><B>pthread_mutex_init</B>(3)</A> +, <A HREF="pthread_mutex_lock.html"><B>pthread_mutex_lock</B>(3)</A> +, <A HREF="pthread_mutex_unlock.html"><B>pthread_mutex_unlock</B>(3)</A> +. +</P> +<H2><A HREF="#toc7" NAME="sect7"><U><FONT COLOR="#000080">Notes</FONT></U></A></H2> +<P>For speed, <B>Pthreads-w32</B> never checks the thread ownership +of mutexes of type <B>PTHREAD_MUTEX_NORMAL</B> (or +<B>PTHREAD_MUTEX_FAST_NP</B>) when performing operations on the +mutex. It is therefore possible for one thread to lock such a mutex +and another to unlock it.</P> +<P><SPAN STYLE="font-weight: medium">When developing code, it is a +common precaution to substitute the error checking type, and drop in +the normal type for release if the extra performance is required.</SPAN></P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Author</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">See + Also</A></P> + <LI><P><A HREF="#sect7" NAME="toc7">Notes</A></P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_mutexattr_setpshared.html b/manual/pthread_mutexattr_setpshared.html new file mode 100644 index 0000000..48cc6d7 --- /dev/null +++ b/manual/pthread_mutexattr_setpshared.html @@ -0,0 +1,149 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>"PTHREAD_MUTEXATTR_GETPSHARED"(P) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050504;23480600"> + <META NAME="CHANGED" CONTENT="20050505;18381800"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_mutexattr_getpshared, pthread_mutexattr_setpshared - get +and set the process-shared attribute +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h> </B> +</P> +<P><B>int pthread_mutexattr_getpshared(const pthread_mutexattr_t * +restrict</B> <I>attr</I><B>, int *restrict</B> <I>pshared</I><B>); +<BR>int pthread_mutexattr_setpshared(pthread_mutexattr_t *</B><I>attr</I><B>, +int</B> <I>pshared</I><B>); </B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>The <B>pthread_mutexattr_getpshared</B> function shall obtain the +value of the <I>process-shared</I> attribute from the attributes +object referenced by <I>attr</I>. The <B>pthread_mutexattr_setpshared</B> +function shall set the <I>process-shared</I> attribute in an +initialized attributes object referenced by <I>attr</I>. +</P> +<P>The <I>process-shared</I> attribute is set to +<B>PTHREAD_PROCESS_SHARED</B> to permit a mutex to be operated upon +by any thread that has access to the memory where the mutex is +allocated, even if the mutex is allocated in memory that is shared by +multiple processes. If the <I>process-shared</I> attribute is +<B>PTHREAD_PROCESS_PRIVATE</B>, the mutex shall only be operated upon +by threads created within the same process as the thread that +initialized the mutex; if threads of differing processes attempt to +operate on such a mutex, the behavior is undefined. The default value +of the attribute shall be <B>PTHREAD_PROCESS_PRIVATE</B>. +</P> +<P><B>Pthreads-w32</B> defines <B>_POSIX_THREAD_PROCESS_SHARED</B> in +pthread.h as -1 to indicate that these routines are implemented but +the process shared option is not supported.</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>Upon successful completion, <B>pthread_mutexattr_setpshared</B> +shall return zero; otherwise, an error number shall be returned to +indicate the error. +</P> +<P>Upon successful completion, <B>pthread_mutexattr_getpshared</B> +shall return zero and store the value of the <I>process-shared</I> +attribute of <I>attr</I> into the object referenced by the <I>pshared</I> +parameter. Otherwise, an error number shall be returned to indicate +the error. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>The <B>pthread_mutexattr_getpshared</B> and +<B>pthread_mutexattr_setpshared</B> functions may fail if: +</P> +<DL> + <DT><B>EINVAL</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The value specified by <I>attr</I> is invalid. + </DD></DL> +<P> +The <B>pthread_mutexattr_setpshared</B> function may fail if: +</P> +<DL> + <DT><B>EINVAL</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The new value specified for the attribute is outside the range of + legal values for that attribute. + </DD><DT> + <B>ENOTSUP</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The new value specified for the attribute is PTHREAD_PROCESS_SHARED. + </DD></DL> +<P> +These functions shall not return an error code of [EINTR]. +</P> +<P><I>The following sections are informative.</I> +</P> +<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2> +<P>None. +</P> +<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2> +<P>None. +</P> +<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2> +<P>None. +</P> +<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2> +<P>None. +</P> +<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2> +<P><A HREF="pthread_cond_init.html"><B>pthread_cond_destroy</B>(3)</A> +<B>,</B> <A HREF="pthread_create.html"><B>pthread_create</B>(3)</A> <B>,</B> +<A HREF="pthread_mutex_init.html"><B>pthread_mutex_destroy</B>(3)</A> +<B>,</B> <A HREF="pthread_mutexattr_init.html"><B>pthread_mutexattr_destroy</B>(3)</A> +<B>,</B> the Base Definitions volume of IEEE Std 1003.1-2001, +<I><pthread.h></I> +</P> +<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2> +<P>Portions of this text are reprinted and reproduced in electronic +form from IEEE Std 1003.1, 2003 Edition, Standard for Information +Technology -- Portable Operating System Interface (POSIX), The Open +Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the +Institute of Electrical and Electronics Engineers, Inc and The Open +Group. In the event of any discrepancy between this version and the +original IEEE and The Open Group Standard, the original IEEE and The +Open Group Standard is the referee document. The original Standard +can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A> +. +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application + Usage</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future + Directions</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See + Also</A> + </P> + <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_num_processors_np.html b/manual/pthread_num_processors_np.html new file mode 100644 index 0000000..3257aba --- /dev/null +++ b/manual/pthread_num_processors_np.html @@ -0,0 +1,55 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>PTHREAD_NUM_PROCESSORS_NP manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;322600"> + <META NAME="CHANGED" CONTENT="20050505;21514100"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P STYLE="font-weight: medium">pthread_num_processors_np – get the +number of processors (CPUs) in use by the process</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h></B> +</P> +<P><B>int pthread_num_processors_np(void);</B></P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P><B>pthread_num_processors_np </B>returns the number of processors +in the system. This implementation actually returns the number of +processors available to the process, which can be a lower number than +the system's number, depending on the process's affinity mask.</P> +<H2><A HREF="#toc3" NAME="sect3">Cancellation</A></H2> +<P>None.</P> +<H2><A HREF="#toc4" NAME="sect4"><FONT COLOR="#000080">Return Value</FONT></A></H2> +<P><B>pthread_num_processors_np</B> returns the number of processors +currently available to the process.</P> +<H2><A HREF="#toc5" NAME="sect5">Errors</A></H2> +<P>None.</P> +<H2><A HREF="#toc6" NAME="sect6">Author</A></H2> +<P>Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Cancellation</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Errors</A> + </P> + <LI><P><A HREF="#sect6" NAME="toc6">Author</A> + </P> +</UL> +</BODY> +</HTML>
\ No newline at end of file diff --git a/manual/pthread_once.html b/manual/pthread_once.html new file mode 100644 index 0000000..2607d38 --- /dev/null +++ b/manual/pthread_once.html @@ -0,0 +1,85 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>PTHREAD_ONCE(3) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;322600"> + <META NAME="CHANGED" CONTENT="20050505;21140800"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_once - once-only initialization +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h></B> +</P> +<P><B>pthread_once_t </B><I>once_control</I> <B>= PTHREAD_ONCE_INIT;</B> +</P> +<P><B>int pthread_once(pthread_once_t *</B><I>once_control</I><B>, +void (*</B><I>init_routine</I><B>) (void));</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>The purpose of <B>pthread_once</B> is to ensure that a piece of +initialization code is executed at most once. The <I>once_control</I> +argument points to a static or extern variable statically initialized +to <B>PTHREAD_ONCE_INIT</B>. +</P> +<P>The first time <B>pthread_once</B> is called with a given +<I>once_control</I> argument, it calls <I>init_routine</I> with no +argument and changes the value of the <I>once_control</I> variable to +record that initialization has been performed. Subsequent calls to +<B>pthread_once</B> with the same <B>once_control</B> argument do +nothing. +</P> +<H2><A HREF="#toc3" NAME="sect3">Cancellation</A></H2> +<P>While <B>pthread_once</B> is not a cancellation point, +<I>init_routine</I> can be. The required effect on <I>once_control</I> +of a cancellation inside the <I>init_routine</I> is to leave it as if +<B>pthread_once</B> had not been called.</P> +<P><B>Pthreads-w32</B> handles <I>init_routine</I> cancellation by +making any threads, that may be waiting on <I>once_control</I>, +re-compete along with any newly arriving threads in the re-running of +<I>init_routine</I>.</P> +<H2><A HREF="#toc4" NAME="sect4">Return Value</A></H2> +<P STYLE="text-decoration: none"><FONT COLOR="#000000"><B>pthread_once</B> +returns 0 on success, or an error code on failure.</FONT></P> +<H2><A HREF="#toc5" NAME="sect5">Errors</A></H2> +<P>The <B>pthread_once</B> function returns the following error code +on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B> + </DT></DL> +</DL> +<P STYLE="margin-left: 2cm"> +The once_control or init_routine parameter is NULL.</P> +<H2><A HREF="#toc6" NAME="sect6">Author</A></H2> +<P>Xavier Leroy <Xavier.Leroy@inria.fr> +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Cancellation</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Errors</A> + </P> + <LI><P><A HREF="#sect6" NAME="toc6">Author</A> + </P> +</UL> +</BODY> +</HTML>
\ No newline at end of file diff --git a/manual/pthread_rwlock_init.html b/manual/pthread_rwlock_init.html new file mode 100644 index 0000000..9baa3dc --- /dev/null +++ b/manual/pthread_rwlock_init.html @@ -0,0 +1,191 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>"PTHREAD_RWLOCK_DESTROY"(P) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;10211800"> + <META NAME="CHANGED" CONTENT="20050505;18563400"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_rwlock_destroy, pthread_rwlock_init - destroy and +initialize a read-write lock object +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h> </B> +</P> +<P><B>pthread_wrlock_t </B><I>rwlock</I> <B>= +PTHREAD_RWLOCK_INITIALIZER;</B></P> +<P><B>int pthread_rwlock_destroy(pthread_rwlock_t *</B><I>rwlock</I><B>); +<BR>int pthread_rwlock_init(pthread_rwlock_t *restrict</B> <I>rwlock</I><B>, +const pthread_rwlockattr_t *restrict</B> <I>attr</I><B>); </B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>The <B>pthread_rwlock_destroy</B> function shall destroy the +read-write lock object referenced by <I>rwlock</I> and release any +resources used by the lock. The effect of subsequent use of the lock +is undefined until the lock is reinitialized by another call to +<B>pthread_rwlock_init</B>. An implementation may cause +<B>pthread_rwlock_destroy</B> to set the object referenced by <I>rwlock</I> +to an invalid value. Results are undefined if <B>pthread_rwlock_destroy</B> +is called when any thread holds <I>rwlock</I>. Attempting to destroy +an uninitialized read-write lock results in undefined behavior. +</P> +<P>The <B>pthread_rwlock_init</B> function shall allocate any +resources required to use the read-write lock referenced by <I>rwlock</I> +and initializes the lock to an unlocked state with attributes +referenced by <I>attr</I>. If <I>attr</I> is NULL, the default +read-write lock attributes shall be used; the effect is the same as +passing the address of a default read-write lock attributes object. +Once initialized, the lock can be used any number of times without +being reinitialized. Results are undefined if <B>pthread_rwlock_init</B> +is called specifying an already initialized read-write lock. Results +are undefined if a read-write lock is used without first being +initialized. +</P> +<P>If the <B>pthread_rwlock_init</B> function fails, <I>rwlock</I> +shall not be initialized and the contents of <I>rwlock</I> are +undefined. +</P> +<P><B>Pthreads-w32</B> supports statically initialized <I>rwlock</I> +objects using <B>PTHREAD_RWLOCK_INITIALIZER</B>. <SPAN STYLE="font-weight: medium"> +An application should still call <B>pthread_rwlock_destroy</B> at +some point to ensure that any resources consumed by the read/write +lock are released.</SPAN></P> +<P>Only the object referenced by <I>rwlock</I> may be used for +performing synchronization. The result of referring to copies of that +object in calls to <B>pthread_rwlock_destroy</B> , +<B>pthread_rwlock_rdlock</B> , <B>pthread_rwlock_timedrdlock</B> , +<B>pthread_rwlock_timedwrlock</B> , <B>pthread_rwlock_tryrdlock</B> , +<B>pthread_rwlock_trywrlock</B> , <B>pthread_rwlock_unlock</B> , or +<B>pthread_rwlock_wrlock</B> is undefined. +</P> +<P><B>Pthreads-w32</B> defines <B>_POSIX_READER_WRITER_LOCKS</B> in +pthread.h as 200112L to indicate that the reader/writer routines are +implemented and may be used.</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>If successful, the <B>pthread_rwlock_destroy</B> and +<B>pthread_rwlock_init</B> functions shall return zero; otherwise, an +error number shall be returned to indicate the error. +</P> +<P>The [EBUSY] and [EINVAL] error checks, if implemented, act as if +they were performed immediately at the beginning of processing for +the function and caused an error return prior to modifying the state +of the read-write lock specified by <I>rwlock</I>. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>The <B>pthread_rwlock_destroy</B> function may fail if: +</P> +<DL> + <DT><B>EBUSY</B> + </DT><DD> + The implementation has detected an attempt to destroy the object + referenced by <I>rwlock</I> while it is locked. + </DD><DT> + <B>EINVAL</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The value specified by <I>rwlock</I> is invalid. + </DD></DL> +<P> +The <B>pthread_rwlock_init</B> function shall fail if: +</P> +<DL> + <DT><B>EAGAIN</B> + </DT><DD> + The system lacked the necessary resources (other than memory) to + initialize another read-write lock. + </DD><DT> + <B>ENOMEM</B> + </DT><DD> + Insufficient memory exists to initialize the read-write lock. + </DD><DD STYLE="margin-left: 0cm; margin-bottom: 0.5cm"> + <BR><BR> + </DD></DL> +<P> +The <B>pthread_rwlock_init</B> function may fail if: +</P> +<DL> + <DT><B>EINVAL</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The value specified by <I>attr</I> is invalid. + </DD></DL> +<P> +These functions shall not return an error code of [EINTR]. +</P> +<P><I>The following sections are informative.</I> +</P> +<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2> +<P>None. +</P> +<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2> +<P>Applications using these and related read-write lock functions may +be subject to priority inversion, as discussed in the Base +Definitions volume of IEEE Std 1003.1-2001, Section 3.285, +Priority Inversion. +</P> +<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2> +<P>None. +</P> +<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2> +<P>None. +</P> +<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2> +<P><A HREF="pthread_rwlock_rdlock.html"><B>pthread_rwlock_rdlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_timedrdlock.html"><B>pthread_rwlock_timedrdlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_timedwrlock.html"><B>pthread_rwlock_timedwrlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_rdlock.html"><B>pthread_rwlock_tryrdlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_wrlock.html"><B>pthread_rwlock_trywrlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_unlock.html"><B>pthread_rwlock_unlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_wrlock.html"><B>pthread_rwlock_wrlock</B>(3)</A> +<B>,</B> the Base Definitions volume of IEEE Std 1003.1-2001, +<I><pthread.h></I> +</P> +<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2> +<P>Portions of this text are reprinted and reproduced in electronic +form from IEEE Std 1003.1, 2003 Edition, Standard for Information +Technology -- Portable Operating System Interface (POSIX), The Open +Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the +Institute of Electrical and Electronics Engineers, Inc and The Open +Group. In the event of any discrepancy between this version and the +original IEEE and The Open Group Standard, the original IEEE and The +Open Group Standard is the referee document. The original Standard +can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A> +. +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application + Usage</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future + Directions</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See + Also</A> + </P> + <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_rwlock_rdlock.html b/manual/pthread_rwlock_rdlock.html new file mode 100644 index 0000000..ed56cb5 --- /dev/null +++ b/manual/pthread_rwlock_rdlock.html @@ -0,0 +1,166 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>"PTHREAD_RWLOCK_RDLOCK"(P) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;10352600"> + <META NAME="CHANGED" CONTENT="20050505;12554200"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_rwlock_rdlock, pthread_rwlock_tryrdlock - lock a +read-write lock object for reading +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h> </B> +</P> +<P><B>int pthread_rwlock_rdlock(pthread_rwlock_t <I>*</I></B><I>rwlock</I><B>); +<BR></B>i<B>nt pthread_rwlock_tryrdlock(pthread_rwlock_t <I>*</I></B><I>rwlock</I><B>); +</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>The <B>pthread_rwlock_rdlock</B> function shall apply a read lock +to the read-write lock referenced by <I>rwlock</I>. The calling +thread acquires the read lock if a writer does not hold the lock and +there are no writers blocked on the lock. +</P> +<P><B>Pthreads-win32</B> does not prefer either writers or readers in +acquiring the lock – all threads enter a single prioritised FIFO +queue. While this may not be optimally efficient for some +applications, it does ensure that one type does not starve the other.</P> +<P>A thread may hold multiple concurrent read locks on <I>rwlock</I> +(that is, successfully call the <B>pthread_rwlock_rdlock</B> function +<I>n</I> times). If so, the application shall ensure that the thread +performs matching unlocks (that is, it calls the +<A HREF="pthread_rwlock_unlock.html"><B>pthread_rwlock_unlock</B>(3)</A> +function <I>n</I> times). +</P> +<P>The <B>pthread_rwlock_tryrdlock</B> function shall apply a read +lock as in the <B>pthread_rwlock_rdlock</B> function, with the +exception that the function shall fail if the equivalent +<B>pthread_rwlock_rdlock</B> call would have blocked the calling +thread. In no case shall the <B>pthread_rwlock_tryrdlock</B> function +ever block; it always either acquires the lock or fails and returns +immediately. +</P> +<P>Results are undefined if any of these functions are called with an +uninitialized read-write lock. +</P> +<P><B>Pthreads-w32</B> does not detect deadlock if the thread already +owns the lock for writing.</P> +<P><B>Pthreads-w32</B> defines <B>_POSIX_READER_WRITER_LOCKS</B> in +pthread.h as 200112L to indicate that the reader/writer routines are +implemented and may be used.</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>If successful, the <B>pthread_rwlock_rdlock</B> function shall +return zero; otherwise, an error number shall be returned to indicate +the error. +</P> +<P>The <B>pthread_rwlock_tryrdlock</B> function shall return zero if +the lock for reading on the read-write lock object referenced by +<I>rwlock</I> is acquired. Otherwise, an error number shall be +returned to indicate the error. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>The <B>pthread_rwlock_tryrdlock</B> function shall fail if: +</P> +<DL> + <DT><B>EBUSY</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The read-write lock could not be acquired for reading because a + writer holds the lock or a writer with the appropriate priority was + blocked on it. + </DD></DL> +<P> +The <B>pthread_rwlock_rdlock</B> and <B>pthread_rwlock_tryrdlock</B> +functions may fail if: +</P> +<DL> + <DT><B>EINVAL</B> + </DT><DD> + The value specified by <I>rwlock</I> does not refer to an + initialized read-write lock object. + </DD><DT> + <B>EAGAIN</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The read lock could not be acquired because the maximum number of + read locks for <I>rwlock</I> has been exceeded. + </DD></DL> +<P> +These functions shall not return an error code of [EINTR]. +</P> +<P><I>The following sections are informative.</I> +</P> +<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2> +<P>None. +</P> +<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2> +<P>Applications using these functions may be subject to priority +inversion, as discussed in the Base Definitions volume of +IEEE Std 1003.1-2001, Section 3.285, Priority Inversion. +</P> +<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2> +<P>None. +</P> +<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2> +<P>None. +</P> +<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2> +<P><A HREF="pthread_rwlock_init.html"><B>pthread_rwlock_destroy</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_timedrdlock.html"><B>pthread_rwlock_timedrdlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_timedwrlock.html"><B>pthread_rwlock_timedwrlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_wrlock.html"><B>pthread_rwlock_trywrlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_unlock.html"><B>pthread_rwlock_unlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_wrlock.html"><B>pthread_rwlock_wrlock</B>(3)</A> +<B>,</B> the Base Definitions volume of IEEE Std 1003.1-2001, +<I><pthread.h></I> +</P> +<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2> +<P>Portions of this text are reprinted and reproduced in electronic +form from IEEE Std 1003.1, 2003 Edition, Standard for Information +Technology -- Portable Operating System Interface (POSIX), The Open +Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the +Institute of Electrical and Electronics Engineers, Inc and The Open +Group. In the event of any discrepancy between this version and the +original IEEE and The Open Group Standard, the original IEEE and The +Open Group Standard is the referee document. The original Standard +can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A> +. +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application + Usage</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future + Directions</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See + Also</A> + </P> + <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_rwlock_timedrdlock.html b/manual/pthread_rwlock_timedrdlock.html new file mode 100644 index 0000000..b0a660f --- /dev/null +++ b/manual/pthread_rwlock_timedrdlock.html @@ -0,0 +1,154 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>"PTHREAD_RWLOCK_TIMEDRDLOCK"(P) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;11101700"> + <META NAME="CHANGED" CONTENT="20050505;12560000"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_rwlock_timedrdlock - lock a read-write lock for reading +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h> <BR></B>#include <time.h> +</P> +<P><B>int pthread_rwlock_timedrdlock(pthread_rwlock_t *restrict</B> +<I>rwlock</I><B>, const struct timespec *restrict</B> <I>abs_timeout</I><B>); +</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>The <B>pthread_rwlock_timedrdlock</B> function shall apply a read +lock to the read-write lock referenced by <I>rwlock</I> as in the +<A HREF="pthread_rwlock_rdlock.html"><B>pthread_rwlock_rdlock</B>(3)</A> +function. However, if the lock cannot be acquired without waiting for +other threads to unlock the lock, this wait shall be terminated when +the specified timeout expires. The timeout shall expire when the +absolute time specified by <I>abs_timeout</I> passes, as measured by +the clock on which timeouts are based (that is, when the value of +that clock equals or exceeds <I>abs_timeout</I>), or if the absolute +time specified by <I>abs_timeout</I> has already been passed at the +time of the call. +</P> +<P>The <B>timespec</B> data type is defined in the <I><time.h></I> +header. Under no circumstances shall the function fail with a timeout +if the lock can be acquired immediately. The validity of the +<I>abs_timeout</I> parameter need not be checked if the lock can be +immediately acquired. +</P> +<P>The calling thread may deadlock if at the time the call is made it +holds a write lock on <I>rwlock</I>. The results are undefined if +this function is called with an uninitialized read-write lock. +</P> +<P><B>Pthreads-w32</B> defines <B>_POSIX_READER_WRITER_LOCKS</B> in +pthread.h as 200112L to indicate that the reader/writer routines are +implemented and may be used.</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>The <B>pthread_rwlock_timedrdlock</B> function shall return zero +if the lock for reading on the read-write lock object referenced by +<I>rwlock</I> is acquired. Otherwise, an error number shall be +returned to indicate the error. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>The <B>pthread_rwlock_timedrdlock</B> function shall fail if: +</P> +<DL> + <DT><B>ETIMEDOUT</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The lock could not be acquired before the specified timeout expired. + </DD></DL> +<P> +The <B>pthread_rwlock_timedrdlock</B> function may fail if: +</P> +<DL> + <DT><B>EAGAIN</B> + </DT><DD> + The read lock could not be acquired because the maximum number of + read locks for lock would be exceeded. + </DD><DT> + <B>EINVAL</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The value specified by <I>rwlock</I> does not refer to an + initialized read-write lock object, or the <I>abs_timeout</I> + nanosecond value is less than zero or greater than or equal to 1000 + million. + </DD></DL> +<P> +This function shall not return an error code of [EINTR]. +</P> +<P><I>The following sections are informative.</I> +</P> +<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2> +<P>None. +</P> +<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2> +<P>Applications using this function may be subject to priority +inversion, as discussed in the Base Definitions volume of +IEEE Std 1003.1-2001, Section 3.285, Priority Inversion. +</P> +<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2> +<P>None. +</P> +<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2> +<P>None. +</P> +<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2> +<P><A HREF="pthread_rwlock_init.html"><B>pthread_rwlock_destroy</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_rdlock.html"><B>pthread_rwlock_rdlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_timedwrlock.html"><B>pthread_rwlock_timedwrlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_rdlock.html"><B>pthread_rwlock_tryrdlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_wrlock.html"><B>pthread_rwlock_trywrlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_unlock.html"><B>pthread_rwlock_unlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_wrlock.html"><B>pthread_rwlock_wrlock</B>(3)</A> +<B>,</B> the Base Definitions volume of IEEE Std 1003.1-2001, +<I><pthread.h></I>, <I><time.h></I> +</P> +<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2> +<P>Portions of this text are reprinted and reproduced in electronic +form from IEEE Std 1003.1, 2003 Edition, Standard for Information +Technology -- Portable Operating System Interface (POSIX), The Open +Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the +Institute of Electrical and Electronics Engineers, Inc and The Open +Group. In the event of any discrepancy between this version and the +original IEEE and The Open Group Standard, the original IEEE and The +Open Group Standard is the referee document. The original Standard +can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A> +. +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application + Usage</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future + Directions</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See + Also</A> + </P> + <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_rwlock_timedwrlock.html b/manual/pthread_rwlock_timedwrlock.html new file mode 100644 index 0000000..c8a9e14 --- /dev/null +++ b/manual/pthread_rwlock_timedwrlock.html @@ -0,0 +1,148 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>"PTHREAD_RWLOCK_TIMEDWRLOCK"(P) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;11172800"> + <META NAME="CHANGED" CONTENT="20050505;12561600"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_rwlock_timedwrlock - lock a read-write lock for writing +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h> <BR></B>#include <time.h> +</P> +<P><B>int pthread_rwlock_timedwrlock(pthread_rwlock_t *restrict</B> +<I>rwlock</I><B>, const struct timespec *restrict</B> <I>abs_timeout</I><B>); +</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>The <B>pthread_rwlock_timedwrlock</B> function shall apply a write +lock to the read-write lock referenced by <I>rwlock</I> as in the +<A HREF="pthread_rwlock_wrlock.html"><B>pthread_rwlock_wrlock</B>(3)</A> +function. However, if the lock cannot be acquired without waiting for +other threads to unlock the lock, this wait shall be terminated when +the specified timeout expires. The timeout shall expire when the +absolute time specified by <I>abs_timeout</I> passes, as measured by +the clock on which timeouts are based (that is, when the value of +that clock equals or exceeds <I>abs_timeout</I>), or if the absolute +time specified by <I>abs_timeout</I> has already been passed at the +time of the call. +</P> +<P>The <B>timespec</B> data type is defined in the <I><time.h></I> +header. Under no circumstances shall the function fail with a timeout +if the lock can be acquired immediately. The validity of the +<I>abs_timeout</I> parameter need not be checked if the lock can be +immediately acquired. +</P> +<P>The calling thread may deadlock if at the time the call is made it +holds the read-write lock. The results are undefined if this function +is called with an uninitialized read-write lock. +</P> +<P><B>Pthreads-w32</B> defines <B>_POSIX_READER_WRITER_LOCKS</B> in +pthread.h as 200112L to indicate that the reader/writer routines are +implemented and may be used.</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>The <B>pthread_rwlock_timedwrlock</B> function shall return zero +if the lock for writing on the read-write lock object referenced by +<I>rwlock</I> is acquired. Otherwise, an error number shall be +returned to indicate the error. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>The <B>pthread_rwlock_timedwrlock</B> function shall fail if: +</P> +<DL> + <DT><B>ETIMEDOUT</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The lock could not be acquired before the specified timeout expired. + </DD></DL> +<P> +The <B>pthread_rwlock_timedwrlock</B> function may fail if: +</P> +<DL> + <DT><B>EINVAL</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The value specified by rwlock does not refer to an initialized + read-write lock object, or the <I>abs_timeout</I> nanosecond value + is less than zero or greater than or equal to 1000 million. + </DD></DL> +<P> +This function shall not return an error code of [EINTR]. +</P> +<P><I>The following sections are informative.</I> +</P> +<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2> +<P>None. +</P> +<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2> +<P>Applications using this function may be subject to priority +inversion, as discussed in the Base Definitions volume of +IEEE Std 1003.1-2001, Section 3.285, Priority Inversion. +</P> +<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2> +<P>None. +</P> +<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2> +<P>None. +</P> +<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2> +<P><A HREF="pthread_rwlock_init.html"><B>pthread_rwlock_destroy</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_rdlock.html"><B>pthread_rwlock_rdlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_timedrdlock.html"><B>pthread_rwlock_timedrdlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_rdlock.html"><B>pthread_rwlock_tryrdlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_wrlock.html"><B>pthread_rwlock_trywrlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_unlock.html"><B>pthread_rwlock_unlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_wrlock.html"><B>pthread_rwlock_wrlock</B>(3)</A> +<B>,</B> the Base Definitions volume of IEEE Std 1003.1-2001, +<I><pthread.h></I>, <I><time.h></I> +</P> +<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2> +<P>Portions of this text are reprinted and reproduced in electronic +form from IEEE Std 1003.1, 2003 Edition, Standard for Information +Technology -- Portable Operating System Interface (POSIX), The Open +Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the +Institute of Electrical and Electronics Engineers, Inc and The Open +Group. In the event of any discrepancy between this version and the +original IEEE and The Open Group Standard, the original IEEE and The +Open Group Standard is the referee document. The original Standard +can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A> +. +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application + Usage</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future + Directions</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See + Also</A> + </P> + <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_rwlock_unlock.html b/manual/pthread_rwlock_unlock.html new file mode 100644 index 0000000..311b5b9 --- /dev/null +++ b/manual/pthread_rwlock_unlock.html @@ -0,0 +1,139 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>"PTHREAD_RWLOCK_UNLOCK"(P) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;11291100"> + <META NAME="CHANGED" CONTENT="20050505;12562700"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_rwlock_unlock - unlock a read-write lock object +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h> </B> +</P> +<P>in<B>t pthread_rwlock_unlock(pthread_rwlock_t <I>*</I></B><I>rwlock</I><B>); +</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>The <B>pthread_rwlock_unlock</B> function shall release a lock +held on the read-write lock object referenced by <I>rwlock</I>. +Results are undefined if the read-write lock <I>rwlock</I> is not +held by the calling thread. +</P> +<P>If this function is called to release a read lock from the +read-write lock object and there are other read locks currently held +on this read-write lock object, the read-write lock object remains in +the read locked state. If this function releases the last read lock +for this read-write lock object, the read-write lock object shall be +put in the unlocked state with no owners. +</P> +<P>If this function is called to release a write lock for this +read-write lock object, the read-write lock object shall be put in +the unlocked state. +</P> +<P><B>Pthreads-win32</B> does not prefer either writers or readers in +acquiring the lock – all threads enter a single prioritised FIFO +queue. While this may not be optimally efficient for some +applications, it does ensure that one type does not starve the other.</P> +<P>Results are undefined if any of these functions are called with an +uninitialized read-write lock. +</P> +<P><B>Pthreads-w32</B> defines <B>_POSIX_READER_WRITER_LOCKS</B> in +pthread.h as 200112L to indicate that the reader/writer routines are +implemented and may be used.</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>If successful, the <B>pthread_rwlock_unlock</B> function shall +return zero; otherwise, an error number shall be returned to indicate +the error. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>The <B>pthread_rwlock_unlock</B> function may fail if: +</P> +<DL> + <DT><B>EINVAL</B> + </DT><DD> + The value specified by <I>rwlock</I> does not refer to an + initialized read-write lock object. + </DD><DD STYLE="margin-left: 0cm; margin-bottom: 0.5cm"> + <BR><BR> + </DD></DL> +<P> +The <B>pthread_rwlock_unlock</B> function shall not return an error +code of [EINTR]. +</P> +<P><I>The following sections are informative.</I> +</P> +<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2> +<P>None. +</P> +<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2> +<P>None. +</P> +<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2> +<P>None. +</P> +<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2> +<P>None. +</P> +<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2> +<P><A HREF="pthread_rwlock_init.html"><B>pthread_rwlock_destroy</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_rdlock.html"><B>pthread_rwlock_rdlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_timedrdlock.html"><B>pthread_rwlock_timedrdlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_timedwrlock.html"><B>pthread_rwlock_timedwrlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_rdlock.html"><B>pthread_rwlock_tryrdlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_wrlock.html"><B>pthread_rwlock_trywrlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_wrlock.html"><B>pthread_rwlock_wrlock</B>(3)</A> +, the Base Definitions volume of IEEE Std 1003.1-2001, +<I><pthread.h></I> +</P> +<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2> +<P>Portions of this text are reprinted and reproduced in electronic +form from IEEE Std 1003.1, 2003 Edition, Standard for Information +Technology -- Portable Operating System Interface (POSIX), The Open +Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the +Institute of Electrical and Electronics Engineers, Inc and The Open +Group. In the event of any discrepancy between this version and the +original IEEE and The Open Group Standard, the original IEEE and The +Open Group Standard is the referee document. The original Standard +can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A> +. +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application + Usage</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future + Directions</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See + Also</A> + </P> + <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_rwlock_wrlock.html b/manual/pthread_rwlock_wrlock.html new file mode 100644 index 0000000..33ee766 --- /dev/null +++ b/manual/pthread_rwlock_wrlock.html @@ -0,0 +1,151 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>"PTHREAD_RWLOCK_TRYWRLOCK"(P) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;11221900"> + <META NAME="CHANGED" CONTENT="20050505;12563800"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_rwlock_trywrlock, pthread_rwlock_wrlock - lock a +read-write lock object for writing +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h> </B> +</P> +<P><B>int pthread_rwlock_trywrlock(pthread_rwlock_t <I>*</I></B><I>rwlock</I><B>); +<BR>int pthread_rwlock_wrlock(pthread_rwlock_t <I>*</I></B><I>rwlock</I><B>); +</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>The <B>pthread_rwlock_trywrlock</B> function shall apply a write +lock like the <B>pthread_rwlock_wrlock</B> function, with the +exception that the function shall fail if any thread currently holds +<I>rwlock</I> (for reading or writing). +</P> +<P>The <B>pthread_rwlock_wrlock</B> function shall apply a write lock +to the read-write lock referenced by <I>rwlock</I>. The calling +thread acquires the write lock if no other thread (reader or writer) +holds the read-write lock <I>rwlock</I>. Otherwise, the thread shall +block until it can acquire the lock. The calling thread may deadlock +if at the time the call is made it holds the read-write lock (whether +a read or write lock). +</P> +<P><B>Pthreads-win32</B> does not prefer either writers or readers in +acquiring the lock – all threads enter a single prioritised FIFO +queue. While this may not be optimally efficient for some +applications, it does ensure that one type does not starve the other.</P> +<P>Results are undefined if any of these functions are called with an +uninitialized read-write lock. +</P> +<P><B>Pthreads-w32</B> defines <B>_POSIX_READER_WRITER_LOCKS</B> in +pthread.h as 200112L to indicate that the reader/writer routines are +implemented and may be used.</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>The <B>pthread_rwlock_trywrlock</B> function shall return zero if +the lock for writing on the read-write lock object referenced by +<I>rwlock</I> is acquired. Otherwise, an error number shall be +returned to indicate the error. +</P> +<P>If successful, the <B>pthread_rwlock_wrlock</B> function shall +return zero; otherwise, an error number shall be returned to indicate +the error. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>The <B>pthread_rwlock_trywrlock</B> function shall fail if: +</P> +<DL> + <DT><B>EBUSY</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The read-write lock could not be acquired for writing because it was + already locked for reading or writing. + </DD></DL> +<P> +The <B>pthread_rwlock_trywrlock</B> and <B>pthread_rwlock_wrlock</B> +functions may fail if: +</P> +<DL> + <DT><B>EINVAL</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The value specified by <I>rwlock</I> does not refer to an + initialized read-write lock object. + </DD></DL> +<P> +These functions shall not return an error code of [EINTR]. +</P> +<P><I>The following sections are informative.</I> +</P> +<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2> +<P>None. +</P> +<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2> +<P>Applications using these functions may be subject to priority +inversion, as discussed in the Base Definitions volume of +IEEE Std 1003.1-2001, Section 3.285, Priority Inversion. +</P> +<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2> +<P>None. +</P> +<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2> +<P>None. +</P> +<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2> +<P><A HREF="pthread_rwlock_init.html"><B>pthread_rwlock_destroy</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_rdlock.html"><B>pthread_rwlock_rdlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_timedrdlock.html"><B>pthread_rwlock_timedrdlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_timedwrlock.html"><B>pthread_rwlock_timedwrlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_rdlock.html"><B>pthread_rwlock_tryrdlock</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlock_unlock.html"><B>pthread_rwlock_unlock</B>(3)</A> +<B>,</B> the Base Definitions volume of IEEE Std 1003.1-2001, +<I><pthread.h></I> +</P> +<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2> +<P>Portions of this text are reprinted and reproduced in electronic +form from IEEE Std 1003.1, 2003 Edition, Standard for Information +Technology -- Portable Operating System Interface (POSIX), The Open +Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the +Institute of Electrical and Electronics Engineers, Inc and The Open +Group. In the event of any discrepancy between this version and the +original IEEE and The Open Group Standard, the original IEEE and The +Open Group Standard is the referee document. The original Standard +can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A> +. +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application + Usage</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future + Directions</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See + Also</A> + </P> + <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_rwlockattr_init.html b/manual/pthread_rwlockattr_init.html new file mode 100644 index 0000000..e43f0cc --- /dev/null +++ b/manual/pthread_rwlockattr_init.html @@ -0,0 +1,139 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>"PTHREAD_RWLOCKATTR_DESTROY"(P) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;504000"> + <META NAME="CHANGED" CONTENT="20050505;18474200"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_rwlockattr_destroy, pthread_rwlockattr_init - destroy and +initialize the read-write lock attributes object +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h> </B> +</P> +<P><B>int pthread_rwlockattr_destroy(pthread_rwlockattr_t <I>*</I></B><I>attr</I><B>); +<BR>int pthread_rwlockattr_init(pthread_rwlockattr_t <I>*</I></B><I>attr</I><B>); +</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>The <B>pthread_rwlockattr_destroy</B> function shall destroy a +read-write lock attributes object. A destroyed <I>attr</I> attributes +object can be reinitialized using <B>pthread_rwlockattr_init</B> ; +the results of otherwise referencing the object after it has been +destroyed are undefined. An implementation may cause +<B>pthread_rwlockattr_destroy</B> to set the object referenced by +<I>attr</I> to an invalid value. +</P> +<P>The <B>pthread_rwlockattr_init</B> function shall initialize a +read-write lock attributes object <I>attr</I> with the default value +for all of the attributes defined by the implementation. +</P> +<P>Results are undefined if <B>pthread_rwlockattr_init</B> is called +specifying an already initialized <I>attr</I> attributes object. +</P> +<P>After a read-write lock attributes object has been used to +initialize one or more read-write locks, any function affecting the +attributes object (including destruction) shall not affect any +previously initialized read-write locks. +</P> +<P><B>Pthreads-w32</B> defines <B>_POSIX_READER_WRITER_LOCKS</B> in +pthread.h as 200112L to indicate that the reader/writer routines are +implemented and may be used.</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>If successful, the <B>pthread_rwlockattr_destroy</B> and +<B>pthread_rwlockattr_init</B> functions shall return zero; +otherwise, an error number shall be returned to indicate the error. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>The <B>pthread_rwlockattr_destroy</B> function may fail if: +</P> +<DL> + <DT><B>EINVAL</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The value specified by <I>attr</I> is invalid. + </DD></DL> +<P> +The <B>pthread_rwlockattr_init</B> function shall fail if: +</P> +<DL> + <DT><B>ENOMEM</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + Insufficient memory exists to initialize the read-write lock + attributes object. + </DD></DL> +<P> +These functions shall not return an error code of [EINTR]. +</P> +<P><I>The following sections are informative.</I> +</P> +<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2> +<P>None. +</P> +<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2> +<P>None. +</P> +<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2> +<P>None. +</P> +<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2> +<P>None. +</P> +<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2> +<P><A HREF="pthread_rwlock_init.html"><B>pthread_rwlock_destroy</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlockattr_setpshared.html"><B>pthread_rwlockattr_getpshared</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlockattr_setpshared.html"><B>pthread_rwlockattr_setpshared</B>(3)</A> +<B>,</B> the Base Definitions volume of IEEE Std 1003.1-2001, +<I><pthread.h></I> +</P> +<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2> +<P>Portions of this text are reprinted and reproduced in electronic +form from IEEE Std 1003.1, 2003 Edition, Standard for Information +Technology -- Portable Operating System Interface (POSIX), The Open +Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the +Institute of Electrical and Electronics Engineers, Inc and The Open +Group. In the event of any discrepancy between this version and the +original IEEE and The Open Group Standard, the original IEEE and The +Open Group Standard is the referee document. The original Standard +can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A> +. +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application + Usage</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future + Directions</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See + Also</A> + </P> + <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_rwlockattr_setpshared.html b/manual/pthread_rwlockattr_setpshared.html new file mode 100644 index 0000000..eeb7e78 --- /dev/null +++ b/manual/pthread_rwlockattr_setpshared.html @@ -0,0 +1,158 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>"PTHREAD_RWLOCKATTR_GETPSHARED"(P) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;10124400"> + <META NAME="CHANGED" CONTENT="20050505;12572100"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_rwlockattr_getpshared, pthread_rwlockattr_setpshared - get +and set the process-shared attribute of the read-write lock +attributes object +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h> </B> +</P> +<P><B>int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t * +restrict </B><I>attr</I><B>, int *restrict</B> <I>pshared</I><B>); +<BR>int pthread_rwlockattr_setpshared(pthread_rwlockattr_t <I>*</I></B><I>attr</I><B>, +int</B> <I>pshared</I><B>); </B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>The <B>pthread_rwlockattr_getpshared</B> function shall obtain the +value of the <I>process-shared</I> attribute from the initialized +attributes object referenced by <I>attr</I>. The +<B>pthread_rwlockattr_setpshared</B> function shall set the +<I>process-shared</I> attribute in an initialized attributes object +referenced by <I>attr</I>. +</P> +<P>The <I>process-shared</I> attribute shall be set to +<B>PTHREAD_PROCESS_SHARED</B> to permit a read-write lock to be +operated upon by any thread that has access to the memory where the +read-write lock is allocated, even if the read-write lock is +allocated in memory that is shared by multiple processes. If the +<I>process-shared</I> attribute is <B>PTHREAD_PROCESS_PRIVATE</B>, +the read-write lock shall only be operated upon by threads created +within the same process as the thread that initialized the read-write +lock; if threads of differing processes attempt to operate on such a +read-write lock, the behavior is undefined. The default value of the +<I>process-shared</I> attribute shall be <B>PTHREAD_PROCESS_PRIVATE</B>. +</P> +<P><B>Pthreads-w32</B> defines <B>_POSIX_THREAD_PROCESS_SHARED</B> in +pthread.h as -1 to indicate that these routines are implemented but +they do not support the process shared option.</P> +<P>Additional attributes, their default values, and the names of the +associated functions to get and set those attribute values are +implementation-defined. +</P> +<P><B>Pthreads-w32</B> defines <B>_POSIX_READER_WRITER_LOCKS</B> in +pthread.h as 200112L to indicate that the reader/writer routines are +implemented and may be used.</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>Upon successful completion, the <B>pthread_rwlockattr_getpshared</B> +function shall return zero and store the value of the <I>process-shared</I> +attribute of <I>attr</I> into the object referenced by the <I>pshared</I> +parameter. Otherwise, an error number shall be returned to indicate +the error. +</P> +<P>If successful, the <B>pthread_rwlockattr_setpshared</B> function +shall return zero; otherwise, an error number shall be returned to +indicate the error. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>The <B>pthread_rwlockattr_getpshared</B> and +<B>pthread_rwlockattr_setpshared</B> functions may fail if: +</P> +<DL> + <DT><B>EINVAL</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The value specified by <I>attr</I> is invalid. + </DD></DL> +<P> +The <B>pthread_rwlockattr_setpshared</B> function may fail if: +</P> +<DL> + <DT><B>EINVAL</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The new value specified for the attribute is outside the range of + legal values for that attribute. + </DD><DT> + <B>ENOTSUP</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The new value specified for the attribute is <B>PTHREAD_PROCESS_SHARED</B>. + </DD></DL> +<P> +These functions shall not return an error code of [EINTR]. +</P> +<P><I>The following sections are informative.</I> +</P> +<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2> +<P>None. +</P> +<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2> +<P>None. +</P> +<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2> +<P>None. +</P> +<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2> +<P>None. +</P> +<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2> +<P><A HREF="pthread_rwlock_init.html"><B>pthread_rwlock_destroy</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlockattr_init.html"><B>pthread_rwlockattr_destroy</B>(3)</A> +<B>,</B> <A HREF="pthread_rwlockattr_init.html"><B>pthread_rwlockattr_init</B>(3)</A> +<B>,</B> the Base Definitions volume of IEEE Std 1003.1-2001, +<I><pthread.h></I> +</P> +<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2> +<P>Portions of this text are reprinted and reproduced in electronic +form from IEEE Std 1003.1, 2003 Edition, Standard for Information +Technology -- Portable Operating System Interface (POSIX), The Open +Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the +Institute of Electrical and Electronics Engineers, Inc and The Open +Group. In the event of any discrepancy between this version and the +original IEEE and The Open Group Standard, the original IEEE and The +Open Group Standard is the referee document. The original Standard +can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A> +. +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application + Usage</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future + Directions</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See + Also</A> + </P> + <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_self.html b/manual/pthread_self.html new file mode 100644 index 0000000..072a198 --- /dev/null +++ b/manual/pthread_self.html @@ -0,0 +1,68 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>PTHREAD_SELF(3) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;11361600"> + <META NAME="CHANGED" CONTENT="20050505;11575700"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_self - return identifier of current thread +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h></B> +</P> +<P><B>pthread_t pthread_self(void);</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P><B>pthread_self</B> return the thread identifier for the calling +thread. +</P> +<P><B>Pthreads-w32</B> also provides support for <B>Win32</B> native +threads to interact with POSIX threads through the pthreads API. +Whereas all threads created via a call to pthread_create have a POSIX +thread ID and thread state, the library ensures that any Win32 native +threads that interact through the Pthreads API also generate a POSIX +thread ID and thread state when and if necessary. This provides full +<SPAN LANG="en-GB">reciprocity</SPAN> between Win32 and POSIX +threads. Win32 native threads that generate a POSIX thread ID and +state are treated by the library as having been created with the +<B>PTHREAD_CREATE_DETACHED</B> attribute.</P> +<P>Any Win32 native thread may call <B>pthread_self</B> directly to +return it's POSIX thread identifier. The ID and state will be +generated if it does not already exist. Win32 native threads do not +need to call <B>pthread_self</B> before calling Pthreads-w32 routines +unless that routine requires a pthread_t parameter.</P> +<H2><A HREF="#toc3" NAME="sect3">Author</A></H2> +<P>Xavier Leroy <Xavier.Leroy@inria.fr> +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<H2><A HREF="#toc4" NAME="sect4">See Also</A></H2> +<P><A HREF="pthread_equal.html"><B>pthread_equal</B>(3)</A> , +<A HREF="pthread_join.html"><B>pthread_join</B>(3)</A> , +<A HREF="pthread_detach.html"><B>pthread_detach</B>(3)</A> , +<A HREF="pthread_setschedparam.html"><B>pthread_setschedparam</B>(3)</A> +, <A HREF="pthread_setschedparam.html"><B>pthread_getschedparam</B>(3)</A> +. +</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Author</A> + </P> + <LI><P><A HREF="#sect4" NAME="toc4">See Also</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_setcancelstate.html b/manual/pthread_setcancelstate.html new file mode 100644 index 0000000..9dacd86 --- /dev/null +++ b/manual/pthread_setcancelstate.html @@ -0,0 +1,205 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>PTHREAD_CANCEL(3) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050504;12090500"> + <META NAME="CHANGED" CONTENT="20050504;16361300"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_cancel, pthread_setcancelstate, pthread_setcanceltype, +pthread_testcancel - thread cancellation +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h></B> +</P> +<P><B>int pthread_cancel(pthread_t </B><I>thread</I><B>);</B> +</P> +<P><B>int pthread_setcancelstate(int </B><I>state</I><B>, int +*</B><I>oldstate</I><B>);</B> +</P> +<P><B>int pthread_setcanceltype(int </B><I>type</I><B>, int +*</B><I>oldtype</I><B>);</B> +</P> +<P><B>void pthread_testcancel(void);</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>Cancellation is the mechanism by which a thread can terminate the +execution of another thread. More precisely, a thread can send a +cancellation request to another thread. Depending on its settings, +the target thread can then either ignore the request, honor it +immediately, or defer it until it reaches a cancellation point. +</P> +<P>When a thread eventually honors a cancellation request, it +performs as if <B>pthread_exit(PTHREAD_CANCELED)</B> has been called +at that point: all cleanup handlers are executed in reverse order, +destructor functions for thread-specific data are called, and finally +the thread stops executing with the return value <B>PTHREAD_CANCELED</B>. +See <A HREF="pthread_exit.html"><B>pthread_exit</B>(3)</A> for more +information. +</P> +<P><B>pthread_cancel</B> sends a cancellation request to the thread +denoted by the <I>thread</I> argument. +</P> +<P><B>pthread_setcancelstate</B> changes the cancellation state for +the calling thread -- that is, whether cancellation requests are +ignored or not. The <I>state</I> argument is the new cancellation +state: either <B>PTHREAD_CANCEL_ENABLE</B> to enable cancellation, or +<B>PTHREAD_CANCEL_DISABLE</B> to disable cancellation (cancellation +requests are ignored). If <I>oldstate</I> is not <B>NULL</B>, the +previous cancellation state is stored in the location pointed to by +<I>oldstate</I>, and can thus be restored later by another call to +<B>pthread_setcancelstate</B>. +</P> +<P><B>pthread_setcanceltype</B> changes the type of responses to +cancellation requests for the calling thread: asynchronous +(immediate) or deferred. The <I>type</I> argument is the new +cancellation type: either <B>PTHREAD_CANCEL_ASYNCHRONOUS</B> to +cancel the calling thread as soon as the cancellation request is +received, or <B>PTHREAD_CANCEL_DEFERRED</B> to keep the cancellation +request pending until the next cancellation point. If <I>oldtype</I> +is not <B>NULL</B>, the previous cancellation state is stored in the +location pointed to by <I>oldtype</I>, and can thus be restored later +by another call to <B>pthread_setcanceltype</B>. +</P> +<P><B>Pthreads-w32</B> provides two levels of support for +<B>PTHREAD_CANCEL_ASYNCHRONOUS</B>: full and partial. Full support +requires an additional DLL and driver be installed on the Windows +system (see the See Also section below) that allows blocked threads +to be cancelled immediately. Partial support means that the target +thread will not cancel until it resumes execution naturally. Partial +support is provided if either the DLL or the driver are not +automatically detected by the pthreads-w32 library at run-time.</P> +<P>Threads are always created by <A HREF="pthread_create.html"><B>pthread_create</B>(3)</A> +with cancellation enabled and deferred. That is, the initial +cancellation state is <B>PTHREAD_CANCEL_ENABLE</B> and the initial +type is <B>PTHREAD_CANCEL_DEFERRED</B>. +</P> +<P>Cancellation points are those points in the program execution +where a test for pending cancellation requests is performed and +cancellation is executed if positive. The following POSIX threads +functions are cancellation points: +</P> +<P><A HREF="pthread_join.html"><B>pthread_join</B>(3)</A> +<BR><A HREF="pthread_cond_wait.html"><B>pthread_cond_wait</B>(3)</A> +<BR><A HREF="pthread_cond_timedwait.html"><B>pthread_cond_timedwait</B>(3)</A> +<BR><A HREF="pthread_testcancel.html"><B>pthread_testcancel</B>(3)</A> +<BR><A HREF="sem_wait.html"><B>sem_wait</B>(3)</A> <BR><A HREF="sem_timedwait.html"><B>sem_timedwait</B>(3)</A> +<BR><A HREF="sigwait.html"><B>sigwait</B>(3)</A> (not supported under +<B>Pthreads-w32</B>)</P> +<P><B>Pthreads-w32</B> provides two functions to enable additional +cancellation points to be created in user functions that block on +Win32 HANDLEs:</P> +<P><A HREF="pthreadCancelableWait.html">pthreadCancelableWait()</A> +<BR><A HREF="pthreadCancelableTimedWait.html">pthreadCancelableTimedWait()</A></P> +<P>All other POSIX threads functions are guaranteed not to be +cancellation points. That is, they never perform cancellation in +deferred cancellation mode. +</P> +<P><B>pthread_testcancel</B> does nothing except testing for pending +cancellation and executing it. Its purpose is to introduce explicit +checks for cancellation in long sequences of code that do not call +cancellation point functions otherwise. +</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P><B>pthread_cancel</B>, <B>pthread_setcancelstate</B> and +<B>pthread_setcanceltype</B> return 0 on success and a non-zero error +code on error. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P><B>pthread_cancel</B> returns the following error code on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ESRCH</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + no thread could be found corresponding to that specified by the + <I>thread</I> ID. + </DD></DL> +</DL> +<P> +<B>pthread_setcancelstate</B> returns the following error code on +error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + the <I>state</I> argument is not + </DD></DL> +</DL> +<BLOCKQUOTE> +<B>PTHREAD_CANCEL_ENABLE</B> nor <B>PTHREAD_CANCEL_DISABLE</B> +</BLOCKQUOTE> +<P><B>pthread_setcanceltype</B> returns the following error code on +error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + the <I>type</I> argument is not + </DD></DL> +</DL> +<BLOCKQUOTE> +<B>PTHREAD_CANCEL_DEFERRED</B> nor <B>PTHREAD_CANCEL_ASYNCHRONOUS</B> +</BLOCKQUOTE> +<H2><A HREF="#toc5" NAME="sect5">Author</A></H2> +<P>Xavier Leroy <Xavier.Leroy@inria.fr> +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<H2><A HREF="#toc6" NAME="sect6">See Also</A></H2> +<P><A HREF="pthread_exit.html"><B>pthread_exit</B>(3)</A> , +<A HREF="pthread_cleanup_push.html"><B>pthread_cleanup_push</B>(3)</A> +, <A HREF="pthread_cleanup_pop.html"><B>pthread_cleanup_pop</B>(3)</A> +, Pthreads-w32 package README file 'Prerequisites' section. +</P> +<H2><A HREF="#toc7" NAME="sect7">Bugs</A></H2> +<P>POSIX specifies that a number of system calls (basically, all +system calls that may block, such as <A HREF="read.html"><B>read</B>(2)</A> +, <A HREF="write.html"><B>write</B>(2)</A> , <A HREF="wait.html"><B>wait</B>(2)</A> +, etc.) and library functions that may call these system calls (e.g. +<A HREF="fprintf.html"><B>fprintf</B>(3)</A> ) are cancellation +points. <B>Pthreads-win32</B> is not integrated enough with the C +library to implement this, and thus none of the C library functions +is a cancellation point. +</P> +<P>A workaround for these calls is to temporarily switch to +asynchronous cancellation (assuming full asynchronous cancellation +support is installed). So, checking for cancellation during a <B>read</B> +system call, for instance, can be achieved as follows: +</P> +<BLOCKQUOTE><BR><BR> +</BLOCKQUOTE> +<PRE STYLE="margin-left: 1cm; margin-right: 1cm">pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldCancelType); +read(fd, buffer, length); +pthread_setcanceltype(oldCancelType, NULL);</PRE> +<HR> +<BLOCKQUOTE><A NAME="toc"></A><B>Table of Contents</B></BLOCKQUOTE> +<UL> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Author</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">See + Also</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE><A HREF="#sect7" NAME="toc7">Bugs</A> + </BLOCKQUOTE> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_setcanceltype.html b/manual/pthread_setcanceltype.html new file mode 100644 index 0000000..2af471e --- /dev/null +++ b/manual/pthread_setcanceltype.html @@ -0,0 +1,205 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>PTHREAD_CANCEL(3) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050504;12090500"> + <META NAME="CHANGED" CONTENT="20050504;16362800"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_cancel, pthread_setcancelstate, pthread_setcanceltype, +pthread_testcancel - thread cancellation +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h></B> +</P> +<P><B>int pthread_cancel(pthread_t </B><I>thread</I><B>);</B> +</P> +<P><B>int pthread_setcancelstate(int </B><I>state</I><B>, int +*</B><I>oldstate</I><B>);</B> +</P> +<P><B>int pthread_setcanceltype(int </B><I>type</I><B>, int +*</B><I>oldtype</I><B>);</B> +</P> +<P><B>void pthread_testcancel(void);</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>Cancellation is the mechanism by which a thread can terminate the +execution of another thread. More precisely, a thread can send a +cancellation request to another thread. Depending on its settings, +the target thread can then either ignore the request, honor it +immediately, or defer it until it reaches a cancellation point. +</P> +<P>When a thread eventually honors a cancellation request, it +performs as if <B>pthread_exit(PTHREAD_CANCELED)</B> has been called +at that point: all cleanup handlers are executed in reverse order, +destructor functions for thread-specific data are called, and finally +the thread stops executing with the return value <B>PTHREAD_CANCELED</B>. +See <A HREF="pthread_exit.html"><B>pthread_exit</B>(3)</A> for more +information. +</P> +<P><B>pthread_cancel</B> sends a cancellation request to the thread +denoted by the <I>thread</I> argument. +</P> +<P><B>pthread_setcancelstate</B> changes the cancellation state for +the calling thread -- that is, whether cancellation requests are +ignored or not. The <I>state</I> argument is the new cancellation +state: either <B>PTHREAD_CANCEL_ENABLE</B> to enable cancellation, or +<B>PTHREAD_CANCEL_DISABLE</B> to disable cancellation (cancellation +requests are ignored). If <I>oldstate</I> is not <B>NULL</B>, the +previous cancellation state is stored in the location pointed to by +<I>oldstate</I>, and can thus be restored later by another call to +<B>pthread_setcancelstate</B>. +</P> +<P><B>pthread_setcanceltype</B> changes the type of responses to +cancellation requests for the calling thread: asynchronous +(immediate) or deferred. The <I>type</I> argument is the new +cancellation type: either <B>PTHREAD_CANCEL_ASYNCHRONOUS</B> to +cancel the calling thread as soon as the cancellation request is +received, or <B>PTHREAD_CANCEL_DEFERRED</B> to keep the cancellation +request pending until the next cancellation point. If <I>oldtype</I> +is not <B>NULL</B>, the previous cancellation state is stored in the +location pointed to by <I>oldtype</I>, and can thus be restored later +by another call to <B>pthread_setcanceltype</B>. +</P> +<P><B>Pthreads-w32</B> provides two levels of support for +<B>PTHREAD_CANCEL_ASYNCHRONOUS</B>: full and partial. Full support +requires an additional DLL and driver be installed on the Windows +system (see the See Also section below) that allows blocked threads +to be cancelled immediately. Partial support means that the target +thread will not cancel until it resumes execution naturally. Partial +support is provided if either the DLL or the driver are not +automatically detected by the pthreads-w32 library at run-time.</P> +<P>Threads are always created by <A HREF="pthread_create.html"><B>pthread_create</B>(3)</A> +with cancellation enabled and deferred. That is, the initial +cancellation state is <B>PTHREAD_CANCEL_ENABLE</B> and the initial +type is <B>PTHREAD_CANCEL_DEFERRED</B>. +</P> +<P>Cancellation points are those points in the program execution +where a test for pending cancellation requests is performed and +cancellation is executed if positive. The following POSIX threads +functions are cancellation points: +</P> +<P><A HREF="pthread_join.html"><B>pthread_join</B>(3)</A> +<BR><A HREF="pthread_cond_wait.html"><B>pthread_cond_wait</B>(3)</A> +<BR><A HREF="pthread_cond_timedwait.html"><B>pthread_cond_timedwait</B>(3)</A> +<BR><A HREF="pthread_testcancel.html"><B>pthread_testcancel</B>(3)</A> +<BR><A HREF="sem_wait.html"><B>sem_wait</B>(3)</A> <BR><A HREF="sem_timedwait.html"><B>sem_timedwait</B>(3)</A> +<BR><A HREF="sigwait.html"><B>sigwait</B>(3)</A> (not supported under +<B>Pthreads-w32</B>)</P> +<P><B>Pthreads-w32</B> provides two functions to enable additional +cancellation points to be created in user functions that block on +Win32 HANDLEs:</P> +<P><A HREF="pthreadCancelableWait.html">pthreadCancelableWait()</A> +<BR><A HREF="pthreadCancelableTimedWait.html">pthreadCancelableTimedWait()</A></P> +<P>All other POSIX threads functions are guaranteed not to be +cancellation points. That is, they never perform cancellation in +deferred cancellation mode. +</P> +<P><B>pthread_testcancel</B> does nothing except testing for pending +cancellation and executing it. Its purpose is to introduce explicit +checks for cancellation in long sequences of code that do not call +cancellation point functions otherwise. +</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P><B>pthread_cancel</B>, <B>pthread_setcancelstate</B> and +<B>pthread_setcanceltype</B> return 0 on success and a non-zero error +code on error. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P><B>pthread_cancel</B> returns the following error code on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ESRCH</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + no thread could be found corresponding to that specified by the + <I>thread</I> ID. + </DD></DL> +</DL> +<P> +<B>pthread_setcancelstate</B> returns the following error code on +error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + the <I>state</I> argument is not + </DD></DL> +</DL> +<BLOCKQUOTE> +<B>PTHREAD_CANCEL_ENABLE</B> nor <B>PTHREAD_CANCEL_DISABLE</B> +</BLOCKQUOTE> +<P><B>pthread_setcanceltype</B> returns the following error code on +error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + the <I>type</I> argument is not + </DD></DL> +</DL> +<BLOCKQUOTE> +<B>PTHREAD_CANCEL_DEFERRED</B> nor <B>PTHREAD_CANCEL_ASYNCHRONOUS</B> +</BLOCKQUOTE> +<H2><A HREF="#toc5" NAME="sect5">Author</A></H2> +<P>Xavier Leroy <Xavier.Leroy@inria.fr> +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<H2><A HREF="#toc6" NAME="sect6">See Also</A></H2> +<P><A HREF="pthread_exit.html"><B>pthread_exit</B>(3)</A> , +<A HREF="pthread_cleanup_push.html"><B>pthread_cleanup_push</B>(3)</A> +, <A HREF="pthread_cleanup_pop.html"><B>pthread_cleanup_pop</B>(3)</A> +, Pthreads-w32 package README file 'Prerequisites' section. +</P> +<H2><A HREF="#toc7" NAME="sect7">Bugs</A></H2> +<P>POSIX specifies that a number of system calls (basically, all +system calls that may block, such as <A HREF="read.html"><B>read</B>(2)</A> +, <A HREF="write.html"><B>write</B>(2)</A> , <A HREF="wait.html"><B>wait</B>(2)</A> +, etc.) and library functions that may call these system calls (e.g. +<A HREF="fprintf.html"><B>fprintf</B>(3)</A> ) are cancellation +points. <B>Pthreads-win32</B> is not integrated enough with the C +library to implement this, and thus none of the C library functions +is a cancellation point. +</P> +<P>A workaround for these calls is to temporarily switch to +asynchronous cancellation (assuming full asynchronous cancellation +support is installed). So, checking for cancellation during a <B>read</B> +system call, for instance, can be achieved as follows: +</P> +<BLOCKQUOTE><BR><BR> +</BLOCKQUOTE> +<PRE STYLE="margin-left: 1cm; margin-right: 1cm">pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldCancelType); +read(fd, buffer, length); +pthread_setcanceltype(oldCancelType, NULL);</PRE> +<HR> +<BLOCKQUOTE><A NAME="toc"></A><B>Table of Contents</B></BLOCKQUOTE> +<UL> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Author</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">See + Also</A> + </BLOCKQUOTE> + <LI><BLOCKQUOTE><A HREF="#sect7" NAME="toc7">Bugs</A> + </BLOCKQUOTE> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_setconcurrency.html b/manual/pthread_setconcurrency.html new file mode 100644 index 0000000..125dd9a --- /dev/null +++ b/manual/pthread_setconcurrency.html @@ -0,0 +1,153 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>"PTHREAD_GETCONCURRENCY"(P) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;19162600"> + <META NAME="CHANGED" CONTENT="20050505;19223800"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_getconcurrency, pthread_setconcurrency - get and set the +level of concurrency +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h> </B> +</P> +<P><B>int pthread_getconcurrency(void);</B> <BR><B>int +pthread_setconcurrency(int</B> <I>new_level</I><B>); </B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>Unbound threads in a process may or may not be required to be +simultaneously active. By default, the threads implementation ensures +that a sufficient number of threads are active so that the process +can continue to make progress. While this conserves system resources, +it may not produce the most effective level of concurrency. +</P> +<P>The <B>pthread_setconcurrency</B> function allows an application +to inform the threads implementation of its desired concurrency +level, <I>new_level</I>. The actual level of concurrency provided by +the implementation as a result of this function call is unspecified. +</P> +<P>If <I>new_level</I> is zero, it causes the implementation to +maintain the concurrency level at its discretion as if +<B>pthread_setconcurrency</B> had never been called. +</P> +<P>The <B>pthread_getconcurrency</B> function shall return the value +set by a previous call to the <B>pthread_setconcurrency</B> function. +If the <B>pthread_setconcurrency</B> function was not previously +called, this function shall return zero to indicate that the +implementation is maintaining the concurrency level. +</P> +<P>A call to <B>pthread_setconcurrency</B> shall inform the +implementation of its desired concurrency level. The implementation +shall use this as a hint, not a requirement. +</P> +<P>If an implementation does not support multiplexing of user threads +on top of several kernel-scheduled entities, the +<B>pthread_setconcurrency</B> and <B>pthread_getconcurrency</B> +functions are provided for source code compatibility but they shall +have no effect when called. To maintain the function semantics, the +<I>new_level</I> parameter is saved when <B>pthread_setconcurrency</B> +is called so that a subsequent call to <B>pthread_getconcurrency</B> +shall return the same value. +</P> +<P><B>Pthreads-w32</B> provides these routines for source code +compatibility only, as described in the previous paragraph.</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>If successful, the <B>pthread_setconcurrency</B> function shall +return zero; otherwise, an error number shall be returned to indicate +the error. +</P> +<P>The <B>pthread_getconcurrency</B> function shall always return the +concurrency level set by a previous call to <B>pthread_setconcurrency</B> +. If the <B>pthread_setconcurrency</B> function has never been +called, <B>pthread_getconcurrency</B> shall return zero. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>The <B>pthread_setconcurrency</B> function shall fail if: +</P> +<DL> + <DT><B>EINVAL</B> + </DT><DD> + The value specified by <I>new_level</I> is negative. + </DD><DT> + <B>EAGAIN</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The value specific by <I>new_level</I> would cause a system resource + to be exceeded. + </DD></DL> +<P> +These functions shall not return an error code of [EINTR]. +</P> +<P><I>The following sections are informative.</I> +</P> +<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2> +<P>None. +</P> +<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2> +<P>Use of these functions changes the state of the underlying +concurrency upon which the application depends. Library developers +are advised to not use the <B>pthread_getconcurrency</B> and +<B>pthread_setconcurrency</B> functions since their use may conflict +with an applications use of these functions. +</P> +<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2> +<P>None. +</P> +<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2> +<P>None. +</P> +<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2> +<P>The Base Definitions volume of IEEE Std 1003.1-2001, +<I><pthread.h></I> +</P> +<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2> +<P>Portions of this text are reprinted and reproduced in electronic +form from IEEE Std 1003.1, 2003 Edition, Standard for Information +Technology -- Portable Operating System Interface (POSIX), The Open +Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the +Institute of Electrical and Electronics Engineers, Inc and The Open +Group. In the event of any discrepancy between this version and the +original IEEE and The Open Group Standard, the original IEEE and The +Open Group Standard is the referee document. The original Standard +can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A> +. +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application + Usage</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future + Directions</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See + Also</A> + </P> + <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_setschedparam.html b/manual/pthread_setschedparam.html new file mode 100644 index 0000000..6813080 --- /dev/null +++ b/manual/pthread_setschedparam.html @@ -0,0 +1,113 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>PTHREAD_SETSCHEDPARAM(3) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050504;18110100"> + <META NAME="CHANGED" CONTENT="20050504;18212800"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_setschedparam, pthread_getschedparam - control thread +scheduling +</P> +<P>parameters +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h></B> +</P> +<P><B>int pthread_setschedparam(pthread_t </B><I>target_thread</I><B>, +int </B><I>policy</I><B>, const struct sched_param *</B><I>param</I><B>);</B> +</P> +<P><B>int pthread_getschedparam(pthread_t </B><I>target_thread</I><B>, +int *</B><I>policy</I><B>, struct sched_param *</B><I>param</I><B>);</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P><B>pthread_setschedparam</B> sets the scheduling parameters for +the thread <I>target_thread</I> as indicated by <I>policy</I> and +<I>param</I>. <I>policy</I> can be either <B>SCHED_OTHER</B> +(regular, non-real-time scheduling), <B>SCHED_RR</B> (real-time, +round-robin) or <B>SCHED_FIFO</B> (real-time, first-in first-out). +<I>param</I> specifies the scheduling priority for the two real-time +policies. See <A HREF="sched_setpolicy.html"><B>sched_setpolicy</B>(2)</A> +for more information on scheduling policies. +</P> +<P><B>Pthreads-w32</B> only supports SCHED_OTHER and does not support +the real-time scheduling policies <B>SCHED_RR</B> and <B>SCHED_FIFO.</B> +</P> +<P><B>pthread_getschedparam</B> retrieves the scheduling policy and +scheduling parameters for the thread <I>target_thread</I> and stores +them in the locations pointed to by <I>policy</I> and <I>param</I>, +respectively. +</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P><B>pthread_setschedparam</B> and <B>pthread_getschedparam</B> +return 0 on success and a non-zero error code on error. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>On error, <B>pthread_setschedparam</B> returns the following error +codes: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ENOTSUP</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + <I>policy</I> is not <B>SCHED_OTHER.</B></DD><DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + <B>EINVAL</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + One of the arguments is invalid, or the priority value specified by + <I>param</I> is not valid for the specified policy.</DD><DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + <B>ESRCH</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + The <I>target_thread</I> is invalid or has already terminated + </DD></DL> +</DL> +<P> +On error, <B>pthread_getschedparam</B> returns the following error +codes: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ESRCH</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + the <I>target_thread</I> is invalid or has already terminated + </DD></DL> +</DL> +<H2> +<A HREF="#toc5" NAME="sect5">Author</A></H2> +<P>Xavier Leroy <Xavier.Leroy@inria.fr> +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<H2><A HREF="#toc6" NAME="sect6">See Also</A></H2> +<P><A HREF="sched_setscheduler.html"><B>sched_setscheduler</B>(2)</A> +, <A HREF="sched_getscheduler.html"><B>sched_getscheduler</B>(2)</A> +, <A HREF="sched_getparam.html"><B>sched_getparam</B>(2)</A> , +<A HREF="pthread_attr_setschedpolicy.html"><B>pthread_attr_setschedpolicy</B>(3)</A> +, <A HREF="pthread_attr_setschedparam.html"><B>pthread_attr_setschedparam</B>(3)</A> +. +</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Author</A> + </P> + <LI><P><A HREF="#sect6" NAME="toc6">See Also</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_spin_init.html b/manual/pthread_spin_init.html new file mode 100644 index 0000000..cd608f6 --- /dev/null +++ b/manual/pthread_spin_init.html @@ -0,0 +1,174 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>"PTHREAD_SPIN_DESTROY"(P) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;12074100"> + <META NAME="CHANGED" CONTENT="20050505;19014200"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_spin_destroy, pthread_spin_init - destroy or initialize a +spin lock object (<B>ADVANCED REALTIME THREADS</B>) +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h> </B> +</P> +<P><B>pthread_spinlock_t</B> <I>lock</I> <B>= +PTHREAD_SPINLOCK_INITIALIZER;</B></P> +<P><B>int pthread_spin_destroy(pthread_spinlock_t *</B><I>lock</I><B>); +<BR>int pthread_spin_init(pthread_spinlock_t *</B><I>lock</I><B>, int</B> +<I>pshared</I><B>); </B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>The <B>pthread_spin_destroy</B> function shall destroy the spin +lock referenced by <I>lock</I> and release any resources used by the +lock. The effect of subsequent use of the lock is undefined until the +lock is reinitialized by another call to <B>pthread_spin_init</B> . +The results are undefined if <B>pthread_spin_destroy</B> is called +when a thread holds the lock, or if this function is called with an +uninitialized thread spin lock. +</P> +<P>The <B>pthread_spin_init</B> function shall allocate any resources +required to use the spin lock referenced by <I>lock</I> and +initialize the lock to an unlocked state. +</P> +<P><B>Pthreads-w32</B> supports single and multiple processor systems +as well as process CPU affinity masking by checking the mask when the +spin lock is initialized. If the process is using only a single +processor at the time <B>pthread_spin_init</B> is called then the +spin lock is initialized as a PTHREAD_MUTEX_NORMAL mutex object. A +thread that calls <A HREF="pthread_spin_lock.html"><B>pthread_spin_lock(3)</B></A> +will block rather than spin in this case. If the process CPU affinity +mask is altered after the spin lock has been initialised, the spin +lock is not modified, and may no longer be optimal for the number of +CPUs available.</P> +<P><B>Pthreads-w32</B> defines <B>_POSIX_THREAD_PROCESS_SHARED</B> in +pthread.h as -1 to indicate that these routines do not support the +<B>PTHREAD_PROCESS_SHARED</B> attribute. <B>pthread_spin_init</B> +will return the error <B>ENOTSUP</B> if the value of <I>pshared</I> +is not <B>PTHREAD_PROCESS_PRIVATE</B>.</P> +<P>The results are undefined if <B>pthread_spin_init</B> is called +specifying an already initialized spin lock. The results are +undefined if a spin lock is used without first being initialized. +</P> +<P>If the <B>pthread_spin_init</B> function fails, the lock is not +initialized and the contents of <I>lock</I> are undefined. +</P> +<P>Only the object referenced by <I>lock</I> may be used for +performing synchronization. +</P> +<P>The result of referring to copies of that object in calls to +<B>pthread_spin_destroy</B> , <A HREF="pthread_spin_lock.html"><B>pthread_spin_lock</B>(3)</A> +, <A HREF="pthread_spin_lock.html"><B>pthread_spin_trylock</B>(3)</A>, +or <A HREF="pthread_spin_unlock.html"><B>pthread_spin_unlock</B>(3)</A> +is undefined. +</P> +<P><B>Pthreads-w32</B> supports statically initialized spin locks +using <B>PTHREAD_SPINLOCK_INITIALIZER</B>. An application should +still call <B>pthread_spin_destroy</B> at some point to ensure that +any resources consumed by the spin lock are released.</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>Upon successful completion, these functions shall return zero; +otherwise, an error number shall be returned to indicate the error. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>These functions may fail if: +</P> +<DL> + <DT><B>EBUSY</B> + </DT><DD> + The implementation has detected an attempt to initialize or destroy + a spin lock while it is in use (for example, while being used in a + <A HREF="pthread_spin_lock.html"><B>pthread_spin_lock</B>(3)</A> + call) by another thread. + </DD><DT> + <B>EINVAL</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The value specified by <I>lock</I> is invalid. + </DD></DL> +<P> +The <B>pthread_spin_init</B> function shall fail if: +</P> +<DL> + <DT><B>ENOTSUP</B> + </DT><DD> + The value of <I>pshared</I> is not <B>PTHREAD_PROCESS_PRIVATE</B>.</DD><DT> + <B>ENOMEM</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + Insufficient memory exists to initialize the lock. + </DD></DL> +<P> +These functions shall not return an error code of [EINTR]. +</P> +<P><I>The following sections are informative.</I> +</P> +<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2> +<P>None. +</P> +<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2> +<P>The <B>pthread_spin_destroy</B> and <B>pthread_spin_init</B> +functions are part of the Spin Locks option and need not be provided +on all implementations. +</P> +<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2> +<P>None. +</P> +<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2> +<P>None. +</P> +<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2> +<P><A HREF="pthread_spin_lock.html"><B>pthread_spin_lock</B>(3)</A> <B>,</B> +<A HREF="pthread_spin_unlock.html"><B>pthread_spin_unlock</B>(3)</A> +<B>,</B> the Base Definitions volume of IEEE Std 1003.1-2001, +<I><pthread.h></I> +</P> +<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2> +<P>Portions of this text are reprinted and reproduced in electronic +form from IEEE Std 1003.1, 2003 Edition, Standard for Information +Technology -- Portable Operating System Interface (POSIX), The Open +Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the +Institute of Electrical and Electronics Engineers, Inc and The Open +Group. In the event of any discrepancy between this version and the +original IEEE and The Open Group Standard, the original IEEE and The +Open Group Standard is the referee document. The original Standard +can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A> +. +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application + Usage</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future + Directions</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See + Also</A> + </P> + <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_spin_lock.html b/manual/pthread_spin_lock.html new file mode 100644 index 0000000..a24965f --- /dev/null +++ b/manual/pthread_spin_lock.html @@ -0,0 +1,139 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>"PTHREAD_SPIN_LOCK"(P) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;12202300"> + <META NAME="CHANGED" CONTENT="20050505;19302300"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_spin_lock, pthread_spin_trylock - lock a spin lock object +(<B>ADVANCED REALTIME THREADS</B>) +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h> </B> +</P> +<P><B>int pthread_spin_lock(pthread_spinlock_t *</B><I>lock</I><B>); +<BR>int pthread_spin_trylock(pthread_spinlock_t *</B><I>lock</I><B>); +</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>The <B>pthread_spin_lock</B> function shall lock the spin lock +referenced by <I>lock</I>. The calling thread shall acquire the lock +if it is not held by another thread. Otherwise, the thread shall spin +(that is, shall not return from the <B>pthread_spin_lock</B> call) +until the lock becomes available. The results are undefined if the +calling thread holds the lock at the time the call is made.</P> +<P><B>Pthreads-w32</B> supports single and multiple processor systems +as well as process CPU affinity masking by checking the mask when the +spin lock is initialized. If the process is using only a single +processor at the time <A HREF="pthread_spin_init.html"><B>pthread_spin_init</B>(3)</A> +is called then the spin lock is initialized as a PTHREAD_MUTEX_NORMAL +mutex object. A thread that calls <B>pthread_spin_lock</B> will block +rather than spin in this case. If the process CPU affinity mask is +altered after the spin lock has been initialised, the spin lock is +not modified, and may no longer be optimal for the number of CPUs +available.</P> +<P>The <B>pthread_spin_trylock</B> function shall lock the spin lock +referenced by <I>lock</I> if it is not held by any thread. Otherwise, +the function shall fail. +</P> +<P>The results are undefined if any of these functions is called with +an uninitialized spin lock. +</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>Upon successful completion, these functions shall return zero; +otherwise, an error number shall be returned to indicate the error. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>These functions may fail if: +</P> +<DL> + <DT><B>EINVAL</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The value specified by <I>lock</I> does not refer to an initialized + spin lock object. + </DD></DL> +<P> +The <B>pthread_spin_trylock</B> function shall fail if: +</P> +<DL> + <DT><B>EBUSY</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + A thread currently holds the lock. + </DD></DL> +<P> +These functions shall not return an error code of [EINTR]. +</P> +<P><I>The following sections are informative.</I> +</P> +<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2> +<P>None. +</P> +<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2> +<P>Applications using this function may be subject to priority +inversion, as discussed in the Base Definitions volume of +IEEE Std 1003.1-2001, Section 3.285, Priority Inversion. +</P> +<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2> +<P>None. +</P> +<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2> +<P>None. +</P> +<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2> +<P><A HREF="pthread_spin_init.html"><B>pthread_spin_destroy</B>(3)</A> +<B>,</B> <A HREF="pthread_spin_unlock.html"><B>pthread_spin_unlock</B>(3)</A> +<B>,</B> the Base Definitions volume of IEEE Std 1003.1-2001, +<I><pthread.h></I> +</P> +<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2> +<P>Portions of this text are reprinted and reproduced in electronic +form from IEEE Std 1003.1, 2003 Edition, Standard for Information +Technology -- Portable Operating System Interface (POSIX), The Open +Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the +Institute of Electrical and Electronics Engineers, Inc and The Open +Group. In the event of any discrepancy between this version and the +original IEEE and The Open Group Standard, the original IEEE and The +Open Group Standard is the referee document. The original Standard +can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A> +. +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application + Usage</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future + Directions</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See + Also</A> + </P> + <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_spin_unlock.html b/manual/pthread_spin_unlock.html new file mode 100644 index 0000000..52a22b7 --- /dev/null +++ b/manual/pthread_spin_unlock.html @@ -0,0 +1,122 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>"PTHREAD_SPIN_UNLOCK"(P) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;12401400"> + <META NAME="CHANGED" CONTENT="20050505;12462400"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>pthread_spin_unlock - unlock a spin lock object (<B>ADVANCED +REALTIME THREADS</B>) +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h> </B> +</P> +<P><B>int pthread_spin_unlock(pthread_spinlock_t *</B><I>lock</I><B>); +</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>The <B>pthread_spin_unlock</B> function shall release the spin +lock referenced by <I>lock</I> which was locked via the +<A HREF="pthread_spin_lock.html"><B>pthread_spin_lock</B>(3)</A> or +<A HREF="pthread_spin_lock.html"><B>pthread_spin_trylock</B>(3)</A> +functions. If there are threads spinning on the lock when +<B>pthread_spin_unlock</B> is called, the lock becomes available and +an unspecified spinning thread shall acquire the lock. +</P> +<P><B>Pthreads-w32</B> does not check ownership of the lock and it is +therefore possible for a thread other than the locker to unlock the +spin lock. This is not a feature that should be exploited.</P> +<P>The results are undefined if this function is called with an +uninitialized thread spin lock. +</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>Upon successful completion, the <B>pthread_spin_unlock</B> +function shall return zero; otherwise, an error number shall be +returned to indicate the error. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>The <B>pthread_spin_unlock</B> function may fail if: +</P> +<DL> + <DT><B>EINVAL</B> + </DT><DD> + An invalid argument was specified. + </DD><DD STYLE="margin-left: -2cm"> + <BR> + </DD></DL> +<P> +This function shall not return an error code of [EINTR]. +</P> +<P><I>The following sections are informative.</I> +</P> +<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2> +<P>None. +</P> +<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2> +<P><B>Pthreads-w32</B> does not check ownership of the lock and it is +therefore possible for a thread other than the locker to unlock the +spin lock. This is not a feature that should be exploited.</P> +<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2> +<P>None. +</P> +<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2> +<P>None. +</P> +<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2> +<P><A HREF="pthread_spin_init.html"><B>pthread_spin_destroy</B>(3)</A> +<B>,</B> <A HREF="pthread_spin_lock.html"><B>pthread_spin_lock</B>(3)</A> +<B>,</B> the Base Definitions volume of IEEE Std 1003.1-2001, +<I><pthread.h></I> +</P> +<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2> +<P>Portions of this text are reprinted and reproduced in electronic +form from IEEE Std 1003.1, 2003 Edition, Standard for Information +Technology -- Portable Operating System Interface (POSIX), The Open +Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the +Institute of Electrical and Electronics Engineers, Inc and The Open +Group. In the event of any discrepancy between this version and the +original IEEE and The Open Group Standard, the original IEEE and The +Open Group Standard is the referee document. The original Standard +can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A> +. +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application + Usage</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future + Directions</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See + Also</A> + </P> + <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/pthread_timechange_handler_np.html b/manual/pthread_timechange_handler_np.html new file mode 100644 index 0000000..f901975 --- /dev/null +++ b/manual/pthread_timechange_handler_np.html @@ -0,0 +1,74 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>PTHREAD_TIMECHANGE_HANDLER_NP manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;322600"> + <META NAME="CHANGED" CONTENT="20050505;22110600"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P STYLE="font-weight: medium">pthread_timechange_handler_np – +alert timed waiting condition variables to system time changes.</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h></B> +</P> +<P><B>void * pthread_timechange_handler_np(void * </B><I>dummy</I><B>);</B></P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>To improve tolerance against operator or time service initiated +system clock changes.</P> +<P><B>pthread_timechange_handler_np </B>can be called by an +application when it receives a WM_TIMECHANGE message from the system. +At present it broadcasts all condition variables so that waiting +threads can wake up and re-evaluate their conditions and restart +their timed waits if required.</P> +<P><B>pthread_timechange_handler_np </B>has the same return type and +argument type as a thread routine so that it may be called directly +through pthread_create(), i.e. as a separate thread. If run as a +thread, the return code must be retrieved through <A HREF="pthread_join.html"><B>pthread_join</B>()</A>.</P> +<P>Although the <I>dummy</I> parameter is required it is not used and +any value including NULL can be given.</P> +<H2><A HREF="#toc3" NAME="sect3">Cancellation</A></H2> +<P>None.</P> +<H2><A HREF="#toc4" NAME="sect4"><FONT COLOR="#000080">Return Value</FONT></A></H2> +<P><B>pthread_timechange_handler_np</B> returns 0 on success, or an +error code.</P> +<H2><A HREF="#toc5" NAME="sect5">Errors</A></H2> +<P>The <B>pthread_timechange_handler_np</B> function returns the +following error code on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EAGAIN</B> + </DT></DL> +</DL> +<P STYLE="margin-left: 2cm; margin-bottom: 0cm"> +To indicate that not all condition variables were signalled for some +reason.</P> +<H2><A HREF="#toc6" NAME="sect6">Author</A></H2> +<P>Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Cancellation</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Errors</A> + </P> + <LI><P><A HREF="#sect6" NAME="toc6">Author</A> + </P> +</UL> +</BODY> +</HTML>
\ No newline at end of file diff --git a/manual/pthread_win32_attach_detach_np.html b/manual/pthread_win32_attach_detach_np.html new file mode 100644 index 0000000..4c8bd38 --- /dev/null +++ b/manual/pthread_win32_attach_detach_np.html @@ -0,0 +1,72 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>PTHREAD_WIN32_ATTACH_DETACH_NP manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;322600"> + <META NAME="CHANGED" CONTENT="20050505;22415600"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P STYLE="font-weight: medium">pthread_win32_process_attach_np, +pthread_win32_process_detach_np, pthread_win32_thread_attach_np, +pthread_win32_thread_detach_np – exposed versions of the +pthreads-w32 DLL dllMain() switch functionality for use when +statically linking the library.</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h></B> +</P> +<P><B>BOOL pthread_win32_process_attach_np (void);</B></P> +<P><B>BOOL pthread_win32_process_detach_np (void);</B></P> +<P><B>BOOL pthread_win32_thread_attach_np (void);</B></P> +<P><B>BOOL pthread_win32_thread_detach_np (void);</B></P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>These functions contain the code normally run via <B>dllMain</B> +when the library is used as a dll but which need to be called +explicitly by an application when the library is statically linked.</P> +<P>You will need to call <B>pthread_win32_process_attach_np</B> +before you can call any pthread routines when statically linking. You +should call <B>pthread_win32_process_detach_np</B> before exiting +your application to clean up.</P> +<P><B>pthread_win32_thread_attach_np</B> is currently a no-op, but +<B>pthread_win32_thread_detach_np</B> is needed to clean up the +implicit pthread handle that is allocated to a Win32 thread if it +calls certain pthreads routines. Call this routine when the Win32 +thread exits.</P> +<P>These functions invariably return TRUE except for +<B>pthread_win32_process_attach_np</B> which will return FALSE if +pthreads-w32 initialisation fails.</P> +<H2><A HREF="#toc3" NAME="sect3">Cancellation</A></H2> +<P>None.</P> +<H2><A HREF="#toc4" NAME="sect4"><FONT COLOR="#000080">Return Value</FONT></A></H2> +<P>These routines return TRUE (non-zero) on success, or FALSE (0) if +they fail.</P> +<H2><A HREF="#toc5" NAME="sect5">Errors</A></H2> +<P>None.</P> +<H2><A HREF="#toc6" NAME="sect6">Author</A></H2> +<P>Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Cancellation</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Errors</A> + </P> + <LI><P><A HREF="#sect6" NAME="toc6">Author</A> + </P> +</UL> +</BODY> +</HTML>
\ No newline at end of file diff --git a/manual/pthread_win32_test_features_np.html b/manual/pthread_win32_test_features_np.html new file mode 100644 index 0000000..fcb9eab --- /dev/null +++ b/manual/pthread_win32_test_features_np.html @@ -0,0 +1,70 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>PTHREAD_WIN32_TEST_FEATURES_NP manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;322600"> + <META NAME="CHANGED" CONTENT="20050505;22310200"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P STYLE="font-weight: medium">pthread_win32_test_features_np – +find out what features were detected at process attach time.</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <pthread.h></B> +</P> +<P><B>BOOL pthread_win32_test_features_np(int</B> <I>mask</I><B>);</B></P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P><B>pthread_win32_test_features_np</B> allows an application to +check which run-time auto-detected features are available within the +library.</P> +<P>The possible features are:</P> +<P><B>PTW32_SYSTEM_INTERLOCKED_COMPARE_EXCHANGE</B></P> +<P STYLE="margin-left: 2cm">Return TRUE if the Win32 version of +InterlockedCompareExchange() is being used. On IA32 systems the +library can use optimised and inlinable assembler versions of +InterlockedExchange() and InterlockedCompareExchange().</P> +<P><B>PTW32_ALERTABLE_ASYNC_CANCEL</B></P> +<P STYLE="margin-left: 2cm">Return TRUE if the QueueUserAPCEx package +QUSEREX.DLL and the AlertDrv.sys driver was detected. This package +provides alertable (pre-emptive) asynchronous threads cancellation. +If this feature returns FALSE then the default async cancel scheme +is in use, which cannot cancel blocked threads.</P> +<P>Features may be OR'ed into the mask parameter, in which case the +routine returns TRUE if any of the OR'ed features would +return TRUE. At this stage it doesn't make sense to OR features but +it may some day.</P> +<H2><A HREF="#toc3" NAME="sect3">Cancellation</A></H2> +<P>None.</P> +<H2><A HREF="#toc4" NAME="sect4"><FONT COLOR="#000080">Return Value</FONT></A></H2> +<P><B>pthread_win32_test_features_np</B> returns TRUE (non-zero) if +any of the specified features is present, and FALSE (0) otherwise.</P> +<H2><A HREF="#toc5" NAME="sect5">Errors</A></H2> +<P>None.</P> +<H2><A HREF="#toc6" NAME="sect6">Author</A></H2> +<P>Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Cancellation</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Errors</A> + </P> + <LI><P><A HREF="#sect6" NAME="toc6">Author</A> + </P> +</UL> +</BODY> +</HTML>
\ No newline at end of file diff --git a/manual/sched_get_priority_max.html b/manual/sched_get_priority_max.html new file mode 100644 index 0000000..2dc1de0 --- /dev/null +++ b/manual/sched_get_priority_max.html @@ -0,0 +1,116 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>"SCHED_GET_PRIORITY_MAX"(P) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;12575100"> + <META NAME="CHANGED" CONTENT="20050505;13005500"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>sched_get_priority_max, sched_get_priority_min - get priority +limits (<B>REALTIME</B>) +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <sched.h> </B> +</P> +<P><B>int sched_get_priority_max(int</B> <I>policy</I><B>); <BR>int +sched_get_priority_min(int</B> <I>policy</I><B>); </B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>The <B>sched_get_priority_max</B> and <B>sched_get_priority_min</B> +functions shall return the appropriate maximum or minimum, +respectively, for the scheduling policy specified by <I>policy</I>. +</P> +<P>The value of <I>policy</I> shall be one of the scheduling policy +values defined in <I><sched.h></I>. +</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>If successful, the <B>sched_get_priority_max</B> and +<B>sched_get_priority_min</B> functions shall return the appropriate +maximum or minimum values, respectively. If unsuccessful, they shall +return a value of -1 and set <I>errno</I> to indicate the error. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>The <B>sched_get_priority_max</B> and <B>sched_get_priority_min</B> +functions shall fail if: +</P> +<DL> + <DT><B>EINVAL</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + The value of the <I>policy</I> parameter does not represent a + defined scheduling policy. + </DD></DL> +<P> +<I>The following sections are informative.</I> +</P> +<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2> +<P>None. +</P> +<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2> +<P>None. +</P> +<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2> +<P>None. +</P> +<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2> +<P>None. +</P> +<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2> +<P><A HREF="sched_getparam.html"><B>sched_getparam</B>(3)</A> <B>,</B> +<A HREF="sched_setparam.html"><B>sched_setparam</B>(3)</A> <B>,</B> +<A HREF="sched_getscheduler.html"><B>sched_getscheduler</B>(3)</A> <B>,</B> +<A HREF="sched_rr_get_interval.html"><B>sched_rr_get_interval</B>(3)</A> +<B>,</B> <A HREF="sched_setscheduler.html"><B>sched_setscheduler</B>(3)</A> +<B>,</B> the Base Definitions volume of IEEE Std 1003.1-2001, +<I><sched.h></I> +</P> +<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2> +<P>Portions of this text are reprinted and reproduced in electronic +form from IEEE Std 1003.1, 2003 Edition, Standard for Information +Technology -- Portable Operating System Interface (POSIX), The Open +Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the +Institute of Electrical and Electronics Engineers, Inc and The Open +Group. In the event of any discrepancy between this version and the +original IEEE and The Open Group Standard, the original IEEE and The +Open Group Standard is the referee document. The original Standard +can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A> +. +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application + Usage</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future + Directions</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See + Also</A> + </P> + <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/sched_getscheduler.html b/manual/sched_getscheduler.html new file mode 100644 index 0000000..7c75ab4 --- /dev/null +++ b/manual/sched_getscheduler.html @@ -0,0 +1,125 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>"SCHED_GETSCHEDULER"(P) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;13153500"> + <META NAME="CHANGED" CONTENT="20050505;13202000"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>sched_getscheduler - get scheduling policy (<B>REALTIME</B>) +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <sched.h> </B> +</P> +<P><B>int sched_getscheduler(pid_t</B> <I>pid</I><B>); </B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>The <B>sched_getscheduler</B> function shall return the scheduling +policy of the process specified by <I>pid</I>. If the value of <I>pid</I> +is negative, the behavior of the <B>sched_getscheduler</B> function +is unspecified. +</P> +<P>The values that can be returned by <B>sched_getscheduler</B> are +defined in the <I><sched.h></I> header. +</P> +<P><B>Pthreads-w32</B> only supports the <B>SCHED_OTHER</B> policy, +which is the only value that can be returned. However, checks on <I>pid</I> +and permissions are performed first so that the other useful side +effects of this routine are retained.</P> +<P>If a process specified by <I>pid</I> exists, and if the calling +process has permission, the scheduling policy shall be returned for +the process whose process ID is equal to <I>pid</I>. +</P> +<P>If <I>pid</I> is zero, the scheduling policy shall be returned for +the calling process. +</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>Upon successful completion, the <B>sched_getscheduler</B> function +shall return the scheduling policy of the specified process. If +unsuccessful, the function shall return -1 and set <I>errno</I> to +indicate the error. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>The <B>sched_getscheduler</B> function shall fail if: +</P> +<DL> + <DT><B>EPERM</B> + </DT><DD> + The requesting process does not have permission to determine the + scheduling policy of the specified process. + </DD><DT> + <B>ESRCH</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + No process can be found corresponding to that specified by <I>pid</I>. + </DD></DL> +<P> +<I>The following sections are informative.</I> +</P> +<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2> +<P>None. +</P> +<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2> +<P>None. +</P> +<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2> +<P>None. +</P> +<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2> +<P>None. +</P> +<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2> +<P><A HREF="sched_setscheduler.html"><B>sched_setscheduler</B>(3)</A> +, the Base Definitions volume of IEEE Std 1003.1-2001, +<I><sched.h></I> +</P> +<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2> +<P>Portions of this text are reprinted and reproduced in electronic +form from IEEE Std 1003.1, 2003 Edition, Standard for Information +Technology -- Portable Operating System Interface (POSIX), The Open +Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the +Institute of Electrical and Electronics Engineers, Inc and The Open +Group. In the event of any discrepancy between this version and the +original IEEE and The Open Group Standard, the original IEEE and The +Open Group Standard is the referee document. The original Standard +can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A> +. +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application + Usage</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future + Directions</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See + Also</A> + </P> + <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/sched_setscheduler.html b/manual/sched_setscheduler.html new file mode 100644 index 0000000..05e0044 --- /dev/null +++ b/manual/sched_setscheduler.html @@ -0,0 +1,179 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>"SCHED_SETSCHEDULER"(P) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;13012200"> + <META NAME="CHANGED" CONTENT="20050505;13193700"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>sched_setscheduler - set scheduling policy and parameters +(<B>REALTIME</B>) +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <sched.h> </B> +</P> +<P><B>int sched_setscheduler(pid_t</B> <I>pid</I><B>, int</B> <I>policy</I><B>, +const struct sched_param *</B><I>param</I><B>); </B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>The <B>sched_setscheduler</B> function shall set the scheduling +policy and scheduling parameters of the process specified by <I>pid</I> +to <I>policy</I> and the parameters specified in the <B>sched_param</B> +structure pointed to by <I>param</I>, respectively. The value of the +<I>sched_priority</I> member in the <B>sched_param</B> structure +shall be any integer within the inclusive priority range for the +scheduling policy specified by <I>policy</I>. If the value of <I>pid</I> +is negative, the behavior of the <B>sched_setscheduler</B> function +is unspecified. +</P> +<P>The possible values for the <I>policy</I> parameter are defined in +the <I><sched.h></I> header. +</P> +<P><B>Pthreads-w32</B> only supports the <B>SCHED_OTHER</B> policy. +Any other value for <I>policy</I> will return failure with errno set +to <B>ENOSYS</B>. However, checks on <I>pid</I> and permissions are +performed first so that the other useful side effects of this routine +are retained.</P> +<P>If a process specified by <I>pid</I> exists, and if the calling +process has permission, the scheduling policy and scheduling +parameters shall be set for the process whose process ID is equal to +<I>pid</I>. +</P> +<P>If <I>pid</I> is zero, the scheduling policy and scheduling +parameters shall be set for the calling process. +</P> +<P>Implementations may require that the requesting process have +permission to set its own scheduling parameters or those of another +process. Additionally, implementation-defined restrictions may apply +as to the appropriate privileges required to set a process’ own +scheduling policy, or another process’ scheduling policy, to a +particular value. +</P> +<P>The <B>sched_setscheduler</B> function shall be considered +successful if it succeeds in setting the scheduling policy and +scheduling parameters of the process specified by <I>pid</I> to the +values specified by <I>policy</I> and the structure pointed to by +<I>param</I>, respectively. +</P> +<P>The effect of this function on individual threads is dependent on +the scheduling contention scope of the threads: +</P> +<DL> + <DT>* + </DT><DD STYLE="margin-bottom: 0.5cm"> + For threads with system scheduling contention scope, these functions + shall have no effect on their scheduling. + </DD><DT> + * + </DT><DD STYLE="margin-bottom: 0.5cm"> + For threads with process scheduling contention scope, the threads’ + scheduling policy and associated parameters shall not be affected. + However, the scheduling of these threads with respect to threads in + other processes may be dependent on the scheduling parameters of + their process, which are governed using these functions. + </DD></DL> +<P> +This function is not atomic with respect to other threads in the +process. Threads may continue to execute while this function call is +in the process of changing the scheduling policy and associated +scheduling parameters for the underlying kernel-scheduled entities +used by the process contention scope threads. +</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>Upon successful completion, the function shall return the former +scheduling policy of the specified process. If the <B>sched_setscheduler</B> +function fails to complete successfully, the policy and scheduling +parameters shall remain unchanged, and the function shall return a +value of -1 and set <I>errno</I> to indicate the error. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>The <B>sched_setscheduler</B> function shall fail if: +</P> +<DL> + <DT><B>EINVAL</B> + </DT><DD> + The value of the <I>policy</I> parameter is invalid, or one or more + of the parameters contained in <I>param</I> is outside the valid + range for the specified scheduling policy. + </DD><DT> + <B>EPERM</B> + </DT><DD> + The requesting process does not have permission to set either or + both of the scheduling parameters or the scheduling policy of the + specified process. + </DD><DT> + <B>ESRCH</B> + </DT><DD STYLE="margin-bottom: 0.5cm"> + No process can be found corresponding to that specified by <I>pid</I>. + </DD></DL> +<P> +<I>The following sections are informative.</I> +</P> +<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2> +<P>None. +</P> +<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2> +<P>None. +</P> +<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2> +<P>None. +</P> +<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2> +<P>None. +</P> +<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2> +<P><A HREF="sched_getscheduler.html"><B>sched_getscheduler</B>(3)</A> +<B>,</B> the Base Definitions volume of IEEE Std 1003.1-2001, +<I><sched.h></I> +</P> +<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2> +<P>Portions of this text are reprinted and reproduced in electronic +form from IEEE Std 1003.1, 2003 Edition, Standard for Information +Technology -- Portable Operating System Interface (POSIX), The Open +Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the +Institute of Electrical and Electronics Engineers, Inc and The Open +Group. In the event of any discrepancy between this version and the +original IEEE and The Open Group Standard, the original IEEE and The +Open Group Standard is the referee document. The original Standard +can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A> +. +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application + Usage</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future + Directions</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See + Also</A> + </P> + <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A> + </P> +</UL> +</BODY> +</HTML> diff --git a/manual/sched_yield.html b/manual/sched_yield.html new file mode 100644 index 0000000..31ea209 --- /dev/null +++ b/manual/sched_yield.html @@ -0,0 +1,96 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>"SCHED_YIELD"(P) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;14034600"> + <META NAME="CHANGED" CONTENT="20050505;14050300"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>sched_yield - yield the processor +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <sched.h> </B> +</P> +<P><B>int sched_yield(void);</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>The <B>sched_yield</B> function shall force the running thread to +relinquish the processor until it again becomes the head of its +thread list. It takes no arguments. +</P> +<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2> +<P>The <B>sched_yield</B> function shall return 0 if it completes +successfully; otherwise, it shall return a value of -1 and set <I>errno</I> +to indicate the error. +</P> +<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2> +<P>No errors are defined. +</P> +<P><I>The following sections are informative.</I> +</P> +<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2> +<P>None. +</P> +<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2> +<P>None. +</P> +<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2> +<P>None. +</P> +<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2> +<P>None. +</P> +<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2> +<P>The Base Definitions volume of IEEE Std 1003.1-2001, +<I><sched.h></I> +</P> +<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2> +<P>Portions of this text are reprinted and reproduced in electronic +form from IEEE Std 1003.1, 2003 Edition, Standard for Information +Technology -- Portable Operating System Interface (POSIX), The Open +Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the +Institute of Electrical and Electronics Engineers, Inc and The Open +Group. In the event of any discrepancy between this version and the +original IEEE and The Open Group Standard, the original IEEE and The +Open Group Standard is the referee document. The original Standard +can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A> +. +</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application + Usage</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future + Directions</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See + Also</A> + </P> + <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A> + </P> +</UL> +</BODY> +</HTML>
\ No newline at end of file diff --git a/manual/sem_init.html b/manual/sem_init.html new file mode 100644 index 0000000..238754f --- /dev/null +++ b/manual/sem_init.html @@ -0,0 +1,200 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> + <TITLE>SEMAPHORES(3) manual page</TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)"> + <META NAME="CREATED" CONTENT="20050505;14061900"> + <META NAME="CHANGED" CONTENT="20050505;16344500"> + <!-- manual page source format generated by PolyglotMan v3.2, --> + <!-- available at http://polyglotman.sourceforge.net/ --> +</HEAD> +<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR"> +<P><A HREF="#toc">Table of Contents</A></P> +<H2><A HREF="#toc0" NAME="sect0">Name</A></H2> +<P>sem_init, sem_wait, sem_trywait, sem_post, sem_getvalue, +sem_destroy - operations on semaphores +</P> +<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2> +<P><B>#include <semaphore.h></B> +</P> +<P><B>int sem_init(sem_t *</B><I>sem</I><B>, int </B><I>pshared</I><B>, +unsigned int </B><I>value</I><B>);</B> +</P> +<P><B>int sem_wait(sem_t * </B><I>sem</I><B>);</B> +</P> +<P><B>int sem_timedwait(sem_t * </B><I>sem</I><SPAN STYLE="font-style: normal">, +<B>const struct timespec *</B></SPAN><I>abstime</I><B>);</B> +</P> +<P><B>int sem_trywait(sem_t * </B><I>sem</I><B>);</B> +</P> +<P><B>int sem_post(sem_t * </B><I>sem</I><B>);</B> +</P> +<P><B>int sem_post_multiple(sem_t * </B><I>sem, </I><SPAN STYLE="font-style: normal"><B>int</B> +</SPAN><I>number</I><B>);</B> +</P> +<P><B>int sem_getvalue(sem_t * </B><I>sem</I><B>, int * </B><I>sval</I><B>);</B> +</P> +<P><B>int sem_destroy(sem_t * </B><I>sem</I><B>);</B> +</P> +<H2><A HREF="#toc2" NAME="sect2">Description</A></H2> +<P>Semaphores are counters for resources shared between threads. The +basic operations on semaphores are: increment the counter atomically, +and wait until the counter is non-null and decrement it atomically. +</P> +<P><B>sem_init</B> initializes the semaphore object pointed to by +<I>sem</I>. The count associated with the semaphore is set initially +to <I>value</I>. The <I>pshared</I> argument indicates whether the +semaphore is local to the current process ( <I>pshared</I> is zero) +or is to be shared between several processes ( <I>pshared</I> is not +zero).</P> +<P><B>Pthreads-w32</B> currently does not support process-shared +semaphores, thus <B>sem_init</B> always returns with error <B>EPERM</B> +if <I>pshared</I> is not zero. +</P> +<P><B>sem_wait</B> atomically decrements <I>sem</I>'s count if it is +greater than 0 and returns immediately or it suspends the calling +thread until it can resume following a call to <B>sem_post</B><SPAN STYLE="font-weight: medium"> +or </SPAN><B>sem_post_multiple</B>.</P> +<P><B>sem_timedwait</B> atomically decrements <I>sem</I>'s count if +it is greater than 0 and returns immediately, or it suspends the +calling thread. If <I>abstime</I> time arrives before the thread can +resume following a call to <B>sem_post</B> or <B>sem_post_multiple</B>, +then <B>sem_timedwait</B> returns with a return code of -1 after +having set <B>errno</B> to <B>ETIMEDOUT</B>. If the call can return +without suspending then <I>abstime</I> is not checked.</P> +<P><B>sem_trywait</B><SPAN STYLE="font-weight: medium"> atomically +decrements <I>sem</I>'s count if it is greater than 0 and returns +immediately, or it returns immediately with a return code of -1 after +having set <B>errno</B> to <B>EAGAIN</B></SPAN>. <B>sem_trywait</B><SPAN STYLE="font-weight: medium"> +never blocks.</SPAN></P> +<P><B>sem_post</B> either releases one thread if there are any +waiting on <I>sem</I>, or it atomically increments <I>sem</I>'s +count.</P> +<P><B>sem_post_multiple</B> either releases multiple threads if there +are any waiting on <I>sem</I><SPAN STYLE="font-style: normal"> and/or +it </SPAN>atomically increases <I>sem</I>'s count. If there are +currently <I>n</I> waiters, where <I>n</I> the largest number less +than or equal to <I>number</I>, then <I>n</I> waiters are released +and <I>sem</I>'s count is incremented by <I>number</I> minus <I>n</I>.</P> +<P><B>sem_getvalue</B> stores in the location pointed to by <I>sval</I> +the current count of the semaphore <I>sem</I>. In the <B>Pthreads-w32</B> +implementation: if the value returned in <I>sval</I> is greater than +or equal to 0 it was the <I>sem</I>'s count at some point during the +call to <B>sem_getvalue</B>. <SPAN STYLE="font-weight: medium">If the +value returned in <I>sval</I> is less than 0 then it's absolute value +represents the number of threads waiting on <I>sem</I> at some point +during the call to </SPAN><B>sem_getvalue. </B><SPAN STYLE="font-weight: medium">POSIX +does not require an implementation of </SPAN><B>sem_getvalue</B><SPAN STYLE="font-weight: medium"> +to return a value in <I>sval</I> that is less than 0, but if it does +then it's absolute value must represent the number of waiters.</SPAN></P> +<P><B>sem_destroy</B> destroys a semaphore object, freeing the +resources it might hold. No threads should be waiting on the +semaphore at the time <B>sem_destroy</B> is called.</P> +<H2><A HREF="#toc3" NAME="sect3">Cancellation</A></H2> +<P><B>sem_wait</B> and <B>sem_timedwait</B> are cancellation points. +</P> +<H2><A HREF="#toc4" NAME="sect4">Async-signal Safety</A></H2> +<P>These routines are not async-cancel safe.</P> +<H2><A HREF="#toc5" NAME="sect5">Return Value</A></H2> +<P>All semaphore functions return 0 on success, or -1 on error in +which case they write an error code in <B>errno</B>. +</P> +<H2><A HREF="#toc6" NAME="sect6">Errors</A></H2> +<P>The <B>sem_init</B> function sets <B>errno</B> to the following +codes on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + <I>value</I> exceeds the maximal counter value <B>_POSIX_SEM_VALUE_MAX</B> + </DD><DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + <B>ENOSYS</B> + </DT></DL> +</DL> +<BLOCKQUOTE STYLE="margin-left: 2cm"> +<I>pshared</I> is not zero +</BLOCKQUOTE> +<P>The <B>sem_timedwait</B> function sets <B>errno</B> to the +following error code on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ETIMEDOUT</B> + </DT></DL> +</DL> +<BLOCKQUOTE STYLE="margin-left: 2cm"> +if <I>abstime</I> arrives before the waiting thread can resume +following a call to <B>sem_post</B> or <B>sem_post_multiple</B>. +</BLOCKQUOTE> +<P>The <B>sem_trywait</B> function sets <B>errno</B> to the following +error code on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EAGAIN</B> + </DT></DL> +</DL> +<BLOCKQUOTE STYLE="margin-left: 2cm"> +if the semaphore count is currently 0 +</BLOCKQUOTE> +<P>The <B>sem_post</B> and <B>sem_post_multiple</B> functions set +<B>errno</B> to the following error code on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ERANGE</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + if after incrementing, the semaphore count would exceed + <B>_POSIX_SEM_VALUE_MAX</B> (the semaphore count is left unchanged + in this case) + </DD></DL> +</DL> +<P> +The <B>sem_destroy</B> function sets <B>errno</B> to the following +error code on error: +</P> +<DL> + <DL> + <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EBUSY</B> + </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm"> + if some threads are currently blocked waiting on the semaphore. + </DD></DL> +</DL> +<H2> +<A HREF="#toc7" NAME="sect7">Author</A></H2> +<P>Xavier Leroy <Xavier.Leroy@inria.fr> +</P> +<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P> +<H2><A HREF="#toc8" NAME="sect8">See Also</A></H2> +<P><A HREF="pthread_mutex_init.html"><B>pthread_mutex_init</B>(3)</A> +, <A HREF="pthread_cond_init.html"><B>pthread_cond_init</B>(3)</A> , +<A HREF="pthread_cancel.html"><B>pthread_cancel</B>(3)</A> . +</P> +<HR> +<P><A NAME="toc"></A><B>Table of Contents</B></P> +<UL> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Cancellation</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Async-signal + Safety</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Return + Value</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Errors</A> + </P> + <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Author</A> + </P> + <LI><P><A HREF="#sect8" NAME="toc8">See Also</A> + </P> +</UL> +</BODY> +</HTML> |