コード例 #1
0
 void set_tss_data(void const* key,
                   boost::shared_ptr<tss_cleanup_function> func,
                   void* tss_data,bool cleanup_existing)
 {
     if(tss_data_node* const current_node=find_tss_data(key))
     {
         if(cleanup_existing && current_node->func && (current_node->value!=0))
         {
             (*current_node->func)(current_node->value);
         }
         if(func || (tss_data!=0))
         {
             current_node->func=func;
             current_node->value=tss_data;
         }
         else
         {
             erase_tss_node(key);
         }
     }
     else
     {
         add_new_tss_node(key,func,tss_data);
     }
 }
コード例 #2
0
ファイル: scheduler_base.hpp プロジェクト: devangb/hpx
 void set_tss_data(void const* key,
     boost::shared_ptr<util::coroutines::detail::tss_cleanup_function>
         const& func, void* tss_data, bool cleanup_existing)
 {
     if (util::coroutines::detail::tss_data_node* const current_node =
             find_tss_data(key))
     {
         if (func || (tss_data != 0))
             current_node->reinit(func, tss_data, cleanup_existing);
         else
             erase_tss_node(key, cleanup_existing);
     }
     else if(func || (tss_data != 0))
     {
         add_new_tss_node(key, func, tss_data);
     }
 }
コード例 #3
0
ファイル: tss.cpp プロジェクト: ltroska/hpx
    void set_tss_data(void const* key,
        std::shared_ptr<tss_cleanup_function> const& func,
        void* tss_data, bool cleanup_existing)
    {
#ifdef HPX_HAVE_THREAD_LOCAL_STORAGE
        if (tss_data_node* const current_node = find_tss_data(key))
        {
            if (func || (tss_data != 0))
                current_node->reinit(func, tss_data, cleanup_existing);
            else
                erase_tss_node(key, cleanup_existing);
        }
        else if(func || (tss_data != 0))
        {
            add_new_tss_node(key, func, tss_data);
        }
#endif
    }