2014-06-26 9:12 GMT+02:00 Etienne Sandré-Chardonnal <etienne.san...@m4x.org>
:

> Hi,
>
> Is it possible to detect the threading model (win32 / pthreads) with the
> preprocessor?
>
> At least I would like to make the code compile in these two cases
>  - mingw-w64 with native win32 thread support : use win32 api
>  - mingw-w64 with pthreads or linux gcc : use c++11
>
> Will _GLIBCXX_HAS_GTHREADS work in these cases or is this mingw-only?
>
> Thanks!
>

The posix threading model enabled toolchains do not interfere or prevent
the use of Win32 threads. In fact, C++ std::thread is a wrapper of a
wrapper (GCC's internal gthread) of a wrapper (winpthreads) of Win32 native
threading primitives.

The best way is actually a configure-time check for std::thread
functionality (e.g. test a simple join() call). I know of no preprocessor
macro.

Ruben


> Etienne
>
>
> ------------------------------------------------------------------------------
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft
> _______________________________________________
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
>
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to