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

Side by Side Diff: src/platform-solaris.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-qnx.cc ('k') | src/platform-win32.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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 return x < 0; 73 return x < 0;
74 } 74 }
75 } 75 }
76 } // namespace std 76 } // namespace std
77 #endif // signbit 77 #endif // signbit
78 78
79 namespace v8 { 79 namespace v8 {
80 namespace internal { 80 namespace internal {
81 81
82 82
83 const char* OS::LocalTimezone(double time) { 83 const char* OS::LocalTimezone(double time, TimezoneCache* cache) {
84 if (std::isnan(time)) return ""; 84 if (std::isnan(time)) return "";
85 time_t tv = static_cast<time_t>(std::floor(time/msPerSecond)); 85 time_t tv = static_cast<time_t>(std::floor(time/msPerSecond));
86 struct tm* t = localtime(&tv); 86 struct tm* t = localtime(&tv);
87 if (NULL == t) return ""; 87 if (NULL == t) return "";
88 return tzname[0]; // The location of the timezone string on Solaris. 88 return tzname[0]; // The location of the timezone string on Solaris.
89 } 89 }
90 90
91 91
92 double OS::LocalTimeOffset() { 92 double OS::LocalTimeOffset(TimezoneCache* cache) {
93 tzset(); 93 tzset();
94 return -static_cast<double>(timezone * msPerSecond); 94 return -static_cast<double>(timezone * msPerSecond);
95 } 95 }
96 96
97 97
98 void* OS::Allocate(const size_t requested, 98 void* OS::Allocate(const size_t requested,
99 size_t* allocated, 99 size_t* allocated,
100 bool is_executable) { 100 bool is_executable) {
101 const size_t msize = RoundUp(requested, getpagesize()); 101 const size_t msize = RoundUp(requested, getpagesize());
102 int prot = PROT_READ | PROT_WRITE | (is_executable ? PROT_EXEC : 0); 102 int prot = PROT_READ | PROT_WRITE | (is_executable ? PROT_EXEC : 0);
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 return munmap(base, size) == 0; 335 return munmap(base, size) == 0;
336 } 336 }
337 337
338 338
339 bool VirtualMemory::HasLazyCommits() { 339 bool VirtualMemory::HasLazyCommits() {
340 // TODO(alph): implement for the platform. 340 // TODO(alph): implement for the platform.
341 return false; 341 return false;
342 } 342 }
343 343
344 } } // namespace v8::internal 344 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-qnx.cc ('k') | src/platform-win32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698