pthread_win32_attach_detach_np.html 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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>PTHREAD_WIN32_ATTACH_DETACH_NP 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;22415600">
  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">pthread_win32_process_attach_np,
  18. pthread_win32_process_detach_np, pthread_win32_thread_attach_np,
  19. pthread_win32_thread_detach_np – exposed versions of the
  20. pthreads-w32 DLL dllMain() switch functionality for use when
  21. statically linking the library.</P>
  22. <H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
  23. <P><B>#include &lt;pthread.h&gt;</B>
  24. </P>
  25. <P><B>BOOL pthread_win32_process_attach_np (void);</B></P>
  26. <P><B>BOOL pthread_win32_process_detach_np (void);</B></P>
  27. <P><B>BOOL pthread_win32_thread_attach_np (void);</B></P>
  28. <P><B>BOOL pthread_win32_thread_detach_np (void);</B></P>
  29. <H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
  30. <P>These functions contain the code normally run via <b>dllMain</b>
  31. when the library is used as a dll but which need to be called
  32. explicitly by an application when the library is statically linked. As of version 2.9.0, the static library built using either MSC or GCC includes RT hooks which will call the pthread_win32_process_*_np routines automatically on start/exit of the application.</P>
  33. <P>You will need to call <B>pthread_win32_process_attach_np</B>
  34. before you can call any pthread routines when statically linking. You
  35. should call <B>pthread_win32_process_detach_np</B> before exiting
  36. your application to clean up.</P>
  37. <P><B>pthread_win32_thread_attach_np</B> is currently a no-op, but
  38. <B>pthread_win32_thread_detach_np</B> is needed to clean up the
  39. implicit pthread handle that is allocated to a Win32 thread if it
  40. calls certain pthreads routines. Call this routine when the Win32
  41. thread exits.</P>
  42. <P>These functions invariably return TRUE except for
  43. <B>pthread_win32_process_attach_np</B> which will return FALSE if
  44. pthreads-w32 initialisation fails.</P>
  45. <H2><A HREF="#toc3" NAME="sect3">Cancellation</A></H2>
  46. <P>None.</P>
  47. <H2><A HREF="#toc4" NAME="sect4"><FONT COLOR="#000080">Return Value</FONT></A></H2>
  48. <P>These routines return TRUE (non-zero) on success, or FALSE (0) if
  49. they fail.</P>
  50. <H2><A HREF="#toc5" NAME="sect5">Errors</A></H2>
  51. <P>None.</P>
  52. <H2><A HREF="#toc6" NAME="sect6">Author</A></H2>
  53. <P>Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
  54. <HR>
  55. <P><A NAME="toc"></A><B>Table of Contents</B></P>
  56. <UL>
  57. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
  58. </P>
  59. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
  60. </P>
  61. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
  62. </P>
  63. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Cancellation</A>
  64. </P>
  65. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Return
  66. Value</A>
  67. </P>
  68. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Errors</A>
  69. </P>
  70. <LI><P><A HREF="#sect6" NAME="toc6">Author</A>
  71. </P>
  72. </UL>
  73. </BODY>
  74. </HTML>