Project

General

Profile

Bug #408 » 0002-thread-safeish-dcmsr-behaviour-for-ancient-compilers.patch

Jan Schlamelcher, 2012-11-21 13:20

View differences:

dcmsr/include/dcmtk/dcmsr/dsrtlist.h
/// the list maintained by this class
OFList<T> ItemList;
};
// ensure emptyItem() is called before main() for at least thread-safeish behaviour
// when not using a c++11 compiler.
#if __cplusplus < 201103L
private:
struct init_threadsafe
{
init_threadsafe()
{
emptyItem();
}
};
static init_threadsafe init_ts;
};
// implement static member for any instantiation
template<class T>
OFTypename DSRListOfItems<T>::init_threadsafe DSRListOfItems<T>::init_ts;
#else
};
#endif // c++11
#endif
(2-2/2)