1
0
镜像自地址 https://git.tukaani.org/xz.git 已同步 2025-06-30 17:36:36 +00:00

xz: Improve the comment about start_time in mytime.c.

start_time is relative to an arbitary point in time, it's not
time of day, so using it for anything else than time differences
wouldn't make sense.
这个提交包含在:
Lasse Collin 2023-02-07 19:07:45 +02:00
父节点 7673ef5aa8
当前提交 1dbe12b90c

查看文件

@ -20,11 +20,16 @@
uint64_t opt_flush_timeout = 0; uint64_t opt_flush_timeout = 0;
// The start_time variable will not represent the actual start time // start_time holds the time when the (de)compression was started.
// if mytime_sigtstp_handler() executes. The signal handler measures // It's from mytime_now() and thus only useful for calculating relative
// the amount of time spent stopped and adds it to start_time. // time differences (elapsed time). start_time is initialized by calling
// So, care must be taken in the future if the actual start time needs // mytime_set_start_time() and modified by mytime_sigtstp_handler().
// to be displayed for any reason. //
// When mytime_sigtstp_handler() is used, start_time is made volatile.
// I'm not sure if that is really required since access to it is guarded
// by signals_block()/signals_unblock() since accessing an uint64_t isn't
// atomic on all systems. But since the variable isn't accessed very
// frequently making it volatile doesn't hurt.
#ifdef USE_SIGTSTP_HANDLER #ifdef USE_SIGTSTP_HANDLER
static volatile uint64_t start_time; static volatile uint64_t start_time;
#else #else