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); } }
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); } }
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 }