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

Side by Side Diff: src/platform-openbsd.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-macos.cc ('k') | src/platform-posix.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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 #include "platform.h" 53 #include "platform.h"
54 #include "v8threads.h" 54 #include "v8threads.h"
55 #include "vm-state-inl.h" 55 #include "vm-state-inl.h"
56 56
57 57
58 namespace v8 { 58 namespace v8 {
59 namespace internal { 59 namespace internal {
60 60
61 61
62 const char* OS::LocalTimezone(double time) { 62 const char* OS::LocalTimezone(double time, TimezoneCache* cache) {
63 if (std::isnan(time)) return ""; 63 if (std::isnan(time)) return "";
64 time_t tv = static_cast<time_t>(std::floor(time/msPerSecond)); 64 time_t tv = static_cast<time_t>(std::floor(time/msPerSecond));
65 struct tm* t = localtime(&tv); 65 struct tm* t = localtime(&tv);
66 if (NULL == t) return ""; 66 if (NULL == t) return "";
67 return t->tm_zone; 67 return t->tm_zone;
68 } 68 }
69 69
70 70
71 double OS::LocalTimeOffset() { 71 double OS::LocalTimeOffset(TimezoneCache* cache) {
72 time_t tv = time(NULL); 72 time_t tv = time(NULL);
73 struct tm* t = localtime(&tv); 73 struct tm* t = localtime(&tv);
74 // tm_gmtoff includes any daylight savings offset, so subtract it. 74 // tm_gmtoff includes any daylight savings offset, so subtract it.
75 return static_cast<double>(t->tm_gmtoff * msPerSecond - 75 return static_cast<double>(t->tm_gmtoff * msPerSecond -
76 (t->tm_isdst > 0 ? 3600 * msPerSecond : 0)); 76 (t->tm_isdst > 0 ? 3600 * msPerSecond : 0));
77 } 77 }
78 78
79 79
80 void* OS::Allocate(const size_t requested, 80 void* OS::Allocate(const size_t requested,
81 size_t* allocated, 81 size_t* allocated,
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 return munmap(base, size) == 0; 355 return munmap(base, size) == 0;
356 } 356 }
357 357
358 358
359 bool VirtualMemory::HasLazyCommits() { 359 bool VirtualMemory::HasLazyCommits() {
360 // TODO(alph): implement for the platform. 360 // TODO(alph): implement for the platform.
361 return false; 361 return false;
362 } 362 }
363 363
364 } } // namespace v8::internal 364 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-macos.cc ('k') | src/platform-posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698