Mercurial > hg > nginx
comparison src/core/ngx_times.c @ 441:da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 28 Sep 2004 08:34:51 +0000 |
parents | 9a97dcdd2421 |
children | 42d11f017717 |
comparison
equal
deleted
inserted
replaced
440:f390d1775430 | 441:da8c5707af39 |
---|---|
1 | |
2 /* | |
3 * Copyright (C) 2002-2004 Igor Sysoev | |
4 */ | |
5 | |
1 | 6 |
2 #include <ngx_config.h> | 7 #include <ngx_config.h> |
3 #include <ngx_core.h> | 8 #include <ngx_core.h> |
4 | 9 |
5 | 10 |
10 static ngx_tm_t ngx_cached_gmtime; | 15 static ngx_tm_t ngx_cached_gmtime; |
11 static ngx_int_t ngx_gmtoff; | 16 static ngx_int_t ngx_gmtoff; |
12 | 17 |
13 | 18 |
14 /* | 19 /* |
15 * In the threaded mode only one thread updates cached time and strings | 20 * In the threaded mode only one thread updates the cached time and strings |
16 * and these operations are protected by the mutex. The reading of the cached | 21 * and these operations are protected by the mutex. The reading of the cached |
17 * time and strings is not protected by the mutex. To avoid the race | 22 * time and strings is not protected by the mutex. To avoid the race |
18 * conditions for non-atomic values we use the NGX_TIME_SLOTS slots to store | 23 * conditions for non-atomic values we use the NGX_TIME_SLOTS slots to store |
19 * time value and strings. Thus thread may get the corrupted values only | 24 * time value and strings. Thus thread may get the corrupted values only |
20 * if it is preempted while copying and then it is not scheduled to run | 25 * if it is preempted while copying and then it is not scheduled to run |
288 mday = yday - (mon * 367 / 12 - 31); | 293 mday = yday - (mon * 367 / 12 - 31); |
289 | 294 |
290 mon += 2; | 295 mon += 2; |
291 | 296 |
292 if (yday >= 306) { | 297 if (yday >= 306) { |
298 | |
293 /* | 299 /* |
294 * there is no "yday" in Win32 SYSTEMTIME | 300 * there is no "yday" in Win32 SYSTEMTIME |
295 * | 301 * |
296 * yday -= 306; | 302 * yday -= 306; |
297 */ | 303 */ |