mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] Solving the Pthreads issue


From: Volker Grabsch
Subject: Re: [Mingw-cross-env-list] Solving the Pthreads issue
Date: Tue, 4 May 2010 05:45:03 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

Martin Lambers <address@hidden> schrieb:
> To use the pthread API both on Linux and on W32 via Mingw-cross-env, I
> had to do the following in my application for each thread function that
> is given to pthread_create():
> 
> void *thread_function(void *ptr)
> {
> #ifdef PTW32_STATIC_LIB
>     pthread_win32_thread_attach_np();
> #endif
> 
>     ... do the work ...
> 
> #ifdef PTW32_STATIC_LIB
>     pthread_win32_thread_detach_np();
> #endif
>     return NULL;
> }
> 
> These extra calls are probably missing in most libraries or applications
> that use pthreads, because they are not necessary on POSIX systems.
> Maybe this is one reason for the failures that were observed on this
> list. 

This is a very interesting work-around. Thanks for sharing!

It might be a good way to fix packages that absolutely need
Pthreads, and could even have a chance to get accepted by the
respective upstream project.


Greets,

    Volker

-- 
Volker Grabsch
---<<(())>>---
Administrator
NotJustHosting GbR




reply via email to

[Prev in Thread] Current Thread [Next in Thread]