lines 6-35 of file: example/multi_thread/pthread/team_pthread.cpp

{xrst_begin team_pthread.cpp}
{xrst_spell
   destructors
}

Pthread Implementation of a Team of AD Threads
##############################################
See :ref:`team_thread.hpp-name` for this routines specifications.

Bug in Cygwin
*************

There is a bug in ``pthread_exit`` ,
using cygwin 5.1 and g++ version 4.3.4,
whereby calling ``pthread_exit`` is not the same as returning from
the corresponding routine.
To be specific, destructors for the vectors are not called
and a memory leaks result.
Set the following preprocessor symbol to 1 to demonstrate this bug:
{xrst_spell_off}
{xrst_code cpp} */
# define DEMONSTRATE_BUG_IN_CYGWIN 0
/* {xrst_code}
{xrst_spell_on}
{xrst_literal
   // BEGIN C++
   // END C++
}

{xrst_end team_pthread.cpp}
