#include <cstdlib>
#include <cstring>
#include <string>
+#include <typeinfo>
#include <sstream>
namespace boost{
}
}
if(previous_module_singleton_initialized == Uninitialized){
- try{
+ BOOST_TRY{
//Now initialize the global map, this function must solve concurrency
//issues between threads of several modules
initialize_global_map_handle();
//before this one. Now marked as initialized
atomic_write32(&this_module_singleton_initialized, Initialized);
}
- catch(...){
+ BOOST_CATCH(...){
//Mark singleton failed to initialize
atomic_write32(&this_module_singleton_initialized, Broken);
- throw;
- }
+ BOOST_RETHROW
+ } BOOST_CATCH_END
}
//If previous state was initializing, this means that another winner thread is
//trying to initialize the singleton. Just wait until completes its work.
}
else{ //(tmp == Uninitialized)
//If not initialized try it again?
- try{
+ BOOST_TRY{
//Remove old global map from the system
intermodule_singleton_helpers::thread_safe_global_map_dependant<ThreadSafeGlobalMap>::remove_old_gmem();
//in-place construction of the global map class
break;
}
}
- catch(...){
+ BOOST_CATCH(...){
//
- throw;
- }
+ BOOST_RETHROW
+ } BOOST_CATCH_END
}
}
}
<ThreadSafeGlobalMap>::find(m_map, typeid(C).name());
if(!rcount){
C *p = new C;
- try{
+ BOOST_TRY{
ref_count_ptr val(p, 0u);
rcount = intermodule_singleton_helpers::thread_safe_global_map_dependant
<ThreadSafeGlobalMap>::insert(m_map, typeid(C).name(), val);
}
- catch(...){
+ BOOST_CATCH(...){
intermodule_singleton_helpers::thread_safe_global_map_dependant
<ThreadSafeGlobalMap>::erase(m_map, typeid(C).name());
delete p;
- throw;
- }
+ BOOST_RETHROW
+ } BOOST_CATCH_END
}
//if(Phoenix){
std::atexit(&atexit_work);