Ticket #11302: boost-tls.patch

File boost-tls.patch, 1.0 KB (added by anonymous, 7 years ago)

proposed patch.

  • boost_1_51_0/libs/thread/src/pthread/once.cpp

    old new  
    88#include <boost/assert.hpp>
    99#include <pthread.h>
    1010#include <stdlib.h>
     11#if defined BOOST_THREAD_PATCH
     12#include <string.h> // memcmp.
     13#endif
    1114#include <memory>
    1215
    1316namespace boost
  • boost_1_58_0/libs/thread/src/pthread/thread.cpp

    old new  
    124124                }
    125125                ~delete_current_thread_tls_key_on_dlclose_t()
    126126                {
    127                     if (current_thread_tls_init_flag.epoch!=BOOST_ONCE_INITIAL_FLAG_VALUE)
     127                    const boost::once_flag uninitialized=BOOST_ONCE_INIT;
     128                    if (memcmp(&current_thread_tls_init_flag,&uninitialized,sizeof(boost::once_flag)))
    128129                    {
    129130                        pthread_key_delete(current_thread_tls_key);
    130131                    }