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

Side by Side Diff: src/platform-posix.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-openbsd.cc ('k') | src/platform-qnx.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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 *usecs = usage.ru_utime.tv_usec; 347 *usecs = usage.ru_utime.tv_usec;
348 return 0; 348 return 0;
349 } 349 }
350 350
351 351
352 double OS::TimeCurrentMillis() { 352 double OS::TimeCurrentMillis() {
353 return Time::Now().ToJsTime(); 353 return Time::Now().ToJsTime();
354 } 354 }
355 355
356 356
357 double OS::DaylightSavingsOffset(double time) { 357 class TimezoneCache {};
358
359
360 TimezoneCache* OS::CreateTimezoneCache() {
361 return NULL;
362 }
363
364
365 void OS::DisposeTimezoneCache(TimezoneCache* cache) {
366 ASSERT(cache == NULL);
367 }
368
369
370 void OS::ClearTimezoneCache(TimezoneCache* cache) {
371 ASSERT(cache == NULL);
372 }
373
374
375 double OS::DaylightSavingsOffset(double time, TimezoneCache*) {
358 if (std::isnan(time)) return nan_value(); 376 if (std::isnan(time)) return nan_value();
359 time_t tv = static_cast<time_t>(std::floor(time/msPerSecond)); 377 time_t tv = static_cast<time_t>(std::floor(time/msPerSecond));
360 struct tm* t = localtime(&tv); 378 struct tm* t = localtime(&tv);
361 if (NULL == t) return nan_value(); 379 if (NULL == t) return nan_value();
362 return t->tm_isdst > 0 ? 3600 * msPerSecond : 0; 380 return t->tm_isdst > 0 ? 3600 * msPerSecond : 0;
363 } 381 }
364 382
365 383
366 void OS::TimeZoneChanged() {}
367
368
369 int OS::GetLastError() { 384 int OS::GetLastError() {
370 return errno; 385 return errno;
371 } 386 }
372 387
373 388
374 // ---------------------------------------------------------------------------- 389 // ----------------------------------------------------------------------------
375 // POSIX stdio support. 390 // POSIX stdio support.
376 // 391 //
377 392
378 FILE* OS::FOpen(const char* path, const char* mode) { 393 FILE* OS::FOpen(const char* path, const char* mode) {
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 796
782 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { 797 void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
783 pthread_key_t pthread_key = LocalKeyToPthreadKey(key); 798 pthread_key_t pthread_key = LocalKeyToPthreadKey(key);
784 int result = pthread_setspecific(pthread_key, value); 799 int result = pthread_setspecific(pthread_key, value);
785 ASSERT_EQ(0, result); 800 ASSERT_EQ(0, result);
786 USE(result); 801 USE(result);
787 } 802 }
788 803
789 804
790 } } // namespace v8::internal 805 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-openbsd.cc ('k') | src/platform-qnx.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698