ps-lite
ps-lite copied to clipboard
Van::GetTimestamp(), a bug or not?
include/ps/internal/van.h:
63 /** 64 * \brief get next available timestamp. thread safe 65 */ 66 int GetTimestamp() { return timestamp_++; }
126 std::atomic
The implementation of GetTimestamp and its comment don't match. GetTimestamp doesn't get "next" availabe timestamp but the current logic timestamp. Meanwhile timestamp_ is initialized as zero. So the first call to GetTimestamp will return zero. Is it okay?