ps-lite icon indicating copy to clipboard operation
ps-lite copied to clipboard

Van::GetTimestamp(), a bug or not?

Open microwish opened this issue 8 years ago • 0 comments

include/ps/internal/van.h:

63 /** 64 * \brief get next available timestamp. thread safe 65 */ 66 int GetTimestamp() { return timestamp_++; }

126 std::atomic timestamp_{0};

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?

microwish avatar Mar 25 '17 03:03 microwish