put the cms::thread_safe attribute in the #ifdef