2010/8/25 Ruben Van Boxem <vanboxem.ru...@gmail.com>:
>>
>> Brand new idea: I define
>> #define _GLIBCXX_HAS_GTHREADS 1
>>
>> This adds thread to std:: and allows me to see what undefined stuff there
>> is! Perfect, no? I'll keep you guys informed.
>>
>> Ruben
>
> Sorry for the SPAM...
>
> Some additional thoughts:
>
> 1. Mingw-w64 compilers define:
> GCC_GTHR_WIN32_H
>
> but only the 4.6 snapshots contain the actual header and implementation.
>
> 2. The GCC header
> lib\gcc\x86_64-w64-mingw32\4.5.0\include\c++\x86_64-w64-mingw32\bits\gthr.h
> will have to have a win32 threads case (around line 153, 4.6 snapshot) and
> include the gthr-win32.h header.
>
> 3. missing types and functions:
> __gthread_time_t will have to be defined to time.h's (actually
> sys/timeb.h's) struct timespec (as in gthr-posix.h).
> __gthread_cond_t is harder than the previous, see for example:
> http://www.cs.wustl.edu/~schmidt/win32-cv-1.html)
> ... (many more, but can't say for sure if the two above aren't the problem)
>
> 4. The defines above should be set by the compiler automatically (once
> everything works of course).
>
> Now I'm stuck :(
>
> Ruben
>

Ruben,

for this we need a posix emulation library, or have to implement in
gthr-win32.h such a beast. For details when __GTHREAD_CXX0X should be
set to 1, see in gcc/gthr.h

   If the following are also defined, you should
     #define __GTHREADS_CXX0X 1
   to enable the c++0x thread library.

Types:
  __gthread_t
  __gthread_time_t

Interface:
int __gthread_create (__gthread_t *thread, void *(*func) (void*), void *args);
int __gthread_join (__gthread_t thread, void **value_ptr);
int __gthread_detach (__gthread_t thread);
int __gthread_equal (__gthread_t t1, __gthread_t t2);
__gthread_t __gthread_self (void);
int __gthread_yield (void);
int __gthread_mutex_timedlock (__gthread_mutex_t *m, const
__gthread_time_t *abs_timeout);
int __gthread_recursive_mutex_timedlock (__gthread_recursive_mutex_t
*m, const __gthread_time_t *abs_time);
int __gthread_recursive_mutex_timedlock (__gthread_recursive_mutex_t
*m, const __gthread_time_t *abs_time);
int __gthread_cond_signal (__gthread_cond_t *cond);
int __gthread_cond_timedwait (__gthread_cond_t *cond,
__gthread_mutex_t *mutex, const __gthread_time_t *abs_timeout);
int __gthread_cond_timedwait_recursive (__gthread_cond_t *cond,
__gthread_recursive_mutex_t *mutex, const __gthread_time_t *abs_time)

If this API is implemented for win32 native, then we can have c++0x
standard conformancy.

Regards,
Kai

-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination

------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to