pthreadCancelableWait.html 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <HTML>
  3. <HEAD>
  4. <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
  5. <TITLE>PTHREADCANCELLABLEWAIT manual page</TITLE>
  6. <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
  7. <META NAME="CREATED" CONTENT="20050505;322600">
  8. <META NAME="CHANGED" CONTENT="20050505;23242300">
  9. <!-- manual page source format generated by PolyglotMan v3.2, -->
  10. <!-- available at http://polyglotman.sourceforge.net/ -->
  11. </HEAD>
  12. <BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
  13. <H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
  14. <P><A HREF="index.html">Reference Index</A></P>
  15. <P><A HREF="#toc">Table of Contents</A></P>
  16. <H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
  17. <P STYLE="font-weight: medium">pthreadCancelableTimedWait,
  18. pthreadCancelableWait – provide cancellation hooks for user Win32
  19. routines</P>
  20. <H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
  21. <P><B>#include &lt;pthread.h&gt;</B>
  22. </P>
  23. <P><B>int pthreadCancelableTimedWait (HANDLE </B><I>waitHandle</I><B>,
  24. DWORD </B><I>timeout</I><B>);</B></P>
  25. <P><B>int pthreadCancelableWait (HANDLE </B><I>waitHandle</I><B>);</B></P>
  26. <H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
  27. <P>These two functions provide hooks into the <A HREF="pthread_cancel.html"><B>pthread_cancel</B></A>()
  28. mechanism that will allow you to wait on a Windows handle and make it
  29. a cancellation point. Both functions block until either the given
  30. Win32 <B>HANDLE</B> is signalled, or <A HREF="pthread_cancel.html"><B>pthread_cancel</B></A>()
  31. has been called. They are implemented using <B>WaitForMultipleObjects</B>
  32. on <I>waitHandle</I> and the manually reset Win32 event handle that
  33. is the target of <A HREF="pthread_cancel.html"><B>pthread_cancel</B></A>().
  34. These routines may be called from Win32 native threads but
  35. <A HREF="pthread_cancel.html"><B>pthread_cancel</B></A>() will
  36. require that thread's POSIX thread ID that the thread must retrieve
  37. using <A HREF="pthread_self.html"><B>pthread_self</B></A>().</P>
  38. <P><B>pthreadCancelableTimedWait</B> is the timed version that will
  39. return with the code <B>ETIMEDOUT</B> if the interval <I>timeout</I>
  40. milliseconds elapses before <I>waitHandle</I> is signalled.</P>
  41. <H2><A HREF="#toc3" NAME="sect3">Cancellation</A></H2>
  42. <P>These routines allow routines that block on Win32 HANDLEs to be
  43. cancellable via <A HREF="pthread_cancel.html"><B>pthread_cancel</B></A>().</P>
  44. <H2><A HREF="#toc4" NAME="sect4">Return Value</A></H2>
  45. <P><BR><BR>
  46. </P>
  47. <H2><A HREF="#toc5" NAME="sect5">Errors</A></H2>
  48. <P>The <B>pthreadCancelableTimedWait</B> function returns the
  49. following error code on error:
  50. </P>
  51. <DL>
  52. <DL>
  53. <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ETIMEDOUT</B>
  54. </DT></DL>
  55. </DL>
  56. <P STYLE="margin-left: 2cm">
  57. The interval <I>timeout</I> milliseconds elapsed before <I>waitHandle</I>
  58. was signalled.</P>
  59. <H2><A HREF="#toc6" NAME="sect6">Author</A></H2>
  60. <P>Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
  61. <H2><A HREF="#toc7" NAME="sect7">See also</A></H2>
  62. <P><A HREF="pthread_cancel.html"><B>pthread_cancel()</B></A>,
  63. <A HREF="pthread_self.html"><B>pthread_self()</B></A></P>
  64. <HR>
  65. <P><A NAME="toc"></A><B>Table of Contents</B></P>
  66. <UL>
  67. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
  68. </P>
  69. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
  70. </P>
  71. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
  72. </P>
  73. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Cancellation</A>
  74. </P>
  75. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4"></A><A HREF="#sect4" NAME="toc4">Return
  76. Value</A><A HREF="#sect4" NAME="toc4"></A>
  77. </P>
  78. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Errors</A>
  79. </P>
  80. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Author</A>
  81. </P>
  82. <LI><P><A HREF="#sect7" NAME="toc7">See also</A>
  83. </P>
  84. </UL>
  85. </BODY>
  86. </HTML>