Andre Poenitz wrote:
> On Tue, Jun 26, 2007 at 04:46:39PM +0100, José Matos wrote:
>>   AFAIR one proposed solution implied the use of boost support for threads. 
>> This would hide the platform specific details.
> 
> Do boost threads work nowadays on Windows?

Yes, also on Windows CE ;)

> 
> I was under the impression that they use pthreads there, which "work",
> but do not generally mix well with Windows native threads. 
> 
> Andre'
> 


namespace boost {

thread::thread(const function0<void>& threadfunc)
    : m_joinable(true)
{
    thread_param param(threadfunc);
#if defined(BOOST_HAS_WINTHREADS)
    m_thread = reinterpret_cast<void*>(_beginthreadex(0, 0, &thread_proxy,
                                           &param, 0, &m_id));
    if (!m_thread)
        throw thread_resource_error();
#elif defined(BOOST_HAS_PTHREADS)
    int res = 0;
    res = pthread_create(&m_thread, 0, &thread_proxy, &param);
    if (res != 0)
        throw thread_resource_error();

-- 
Peter Kümmel

Reply via email to