Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(322)

Side by Side Diff: src/platform-linux.cc

Issue 197023002: Fix a race in initialization of timezone cache in platform-win32. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix CE Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/platform-freebsd.cc ('k') | src/platform-macos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 "http://code.google.com/p/v8/issues/detail?id=2140" 111 "http://code.google.com/p/v8/issues/detail?id=2140"
112 112
113 #endif 113 #endif
114 #endif 114 #endif
115 #undef GCC_VERSION 115 #undef GCC_VERSION
116 } 116 }
117 117
118 #endif // def __arm__ 118 #endif // def __arm__
119 119
120 120
121 const char* OS::LocalTimezone(double time) { 121 const char* OS::LocalTimezone(double time, TimezoneCache* cache) {
122 if (std::isnan(time)) return ""; 122 if (std::isnan(time)) return "";
123 time_t tv = static_cast<time_t>(std::floor(time/msPerSecond)); 123 time_t tv = static_cast<time_t>(std::floor(time/msPerSecond));
124 struct tm* t = localtime(&tv); 124 struct tm* t = localtime(&tv);
125 if (NULL == t) return ""; 125 if (NULL == t) return "";
126 return t->tm_zone; 126 return t->tm_zone;
127 } 127 }
128 128
129 129
130 double OS::LocalTimeOffset() { 130 double OS::LocalTimeOffset(TimezoneCache* cache) {
131 time_t tv = time(NULL); 131 time_t tv = time(NULL);
132 struct tm* t = localtime(&tv); 132 struct tm* t = localtime(&tv);
133 // tm_gmtoff includes any daylight savings offset, so subtract it. 133 // tm_gmtoff includes any daylight savings offset, so subtract it.
134 return static_cast<double>(t->tm_gmtoff * msPerSecond - 134 return static_cast<double>(t->tm_gmtoff * msPerSecond -
135 (t->tm_isdst > 0 ? 3600 * msPerSecond : 0)); 135 (t->tm_isdst > 0 ? 3600 * msPerSecond : 0));
136 } 136 }
137 137
138 138
139 void* OS::Allocate(const size_t requested, 139 void* OS::Allocate(const size_t requested,
140 size_t* allocated, 140 size_t* allocated,
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 #endif 449 #endif
450 return munmap(base, size) == 0; 450 return munmap(base, size) == 0;
451 } 451 }
452 452
453 453
454 bool VirtualMemory::HasLazyCommits() { 454 bool VirtualMemory::HasLazyCommits() {
455 return true; 455 return true;
456 } 456 }
457 457
458 } } // namespace v8::internal 458 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-freebsd.cc ('k') | src/platform-macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698