BoyeGuillaume / Casimir

0 stars 0 forks source link

fix: the gmtime and gmtime_s in the formattedTime function may not be thread-safe #2

Open BoyeGuillaume opened 3 years ago

BoyeGuillaume commented 3 years ago

The gmtime and gmtime_s may not be thread-safe

in the Casimir::formattedTime() of the file private-context.cpp

See https://en.cppreference.com/w/c/chrono/gmtime for further information about gmtime and gmtime_s. It will required the use of the Mutex class in the future to make this possibly thread-safe. We could also use gmtime_r but it won't be available on every platform

BoyeGuillaume commented 3 years ago

Furthermore i don't know if the usage of gmtime (that return a pointer) actually get ride-of this pointer once used (probability not). So we should find a better way to do so...