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

Re: c++ and rtl / posix_types.h



      
> Next, how was in sucess to mix stl headers and kernel headers ?     
> stl_alloc.h fails with PTHREAD_MUTEX_INITIALIZER

    template <bool __threads, int __inst>
    pthread_mutex_t
    __default_alloc_template<__threads, __inst>::_S_node_allocator_lock
        = PTHREAD_MUTEX_INITIALIZER;

Well, this expands in kernel to:


    template <bool __threads, int __inst>
    pthread_mutex_t
    __default_alloc_template<__threads, __inst>::_S_node_allocator_lock
        = { 0,0,1, (spinlock_t) { } , PTHREAD_MUTEX_DEFAULT, { 0  } , PTHREAD_PRIO_NONE } ;


and in user space to:

    template <bool __threads, int __inst>
    pthread_mutex_t
    __default_alloc_template<__threads, __inst>::_S_node_allocator_lock
        = {0, 0, 0, PTHREAD_MUTEX_FAST_NP, {0, 0}} ;

Should posix not be same ?

Thanks	Olaf