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

Side by Side Diff: src/base/platform/platform-posix.cc

Issue 1369673003: [presubmit] Enable runtime/threadsafe_fn linter checking. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « src/base/platform/platform-openbsd.cc ('k') | src/base/platform/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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Platform-specific code for POSIX goes here. This is not a platform on its 5 // Platform-specific code for POSIX goes here. This is not a platform on its
6 // own, but contains the parts which are the same across the POSIX platforms 6 // own, but contains the parts which are the same across the POSIX platforms
7 // Linux, MacOS, FreeBSD, OpenBSD, NetBSD and QNX. 7 // Linux, MacOS, FreeBSD, OpenBSD, NetBSD and QNX.
8 8
9 #include <errno.h> 9 #include <errno.h>
10 #include <limits.h> 10 #include <limits.h>
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 377
378 378
379 void OS::ClearTimezoneCache(TimezoneCache* cache) { 379 void OS::ClearTimezoneCache(TimezoneCache* cache) {
380 DCHECK(cache == NULL); 380 DCHECK(cache == NULL);
381 } 381 }
382 382
383 383
384 double OS::DaylightSavingsOffset(double time, TimezoneCache*) { 384 double OS::DaylightSavingsOffset(double time, TimezoneCache*) {
385 if (std::isnan(time)) return std::numeric_limits<double>::quiet_NaN(); 385 if (std::isnan(time)) return std::numeric_limits<double>::quiet_NaN();
386 time_t tv = static_cast<time_t>(std::floor(time/msPerSecond)); 386 time_t tv = static_cast<time_t>(std::floor(time/msPerSecond));
387 struct tm* t = localtime(&tv); 387 struct tm* t = localtime(&tv); // NOLINT(runtime/threadsafe_fn)
388 if (NULL == t) return std::numeric_limits<double>::quiet_NaN(); 388 if (NULL == t) return std::numeric_limits<double>::quiet_NaN();
389 return t->tm_isdst > 0 ? 3600 * msPerSecond : 0; 389 return t->tm_isdst > 0 ? 3600 * msPerSecond : 0;
390 } 390 }
391 391
392 392
393 int OS::GetLastError() { 393 int OS::GetLastError() {
394 return errno; 394 return errno;
395 } 395 }
396 396
397 397
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 748
749 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { 749 void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
750 pthread_key_t pthread_key = LocalKeyToPthreadKey(key); 750 pthread_key_t pthread_key = LocalKeyToPthreadKey(key);
751 int result = pthread_setspecific(pthread_key, value); 751 int result = pthread_setspecific(pthread_key, value);
752 DCHECK_EQ(0, result); 752 DCHECK_EQ(0, result);
753 USE(result); 753 USE(result);
754 } 754 }
755 755
756 } // namespace base 756 } // namespace base
757 } // namespace v8 757 } // namespace v8
OLDNEW
« no previous file with comments | « src/base/platform/platform-openbsd.cc ('k') | src/base/platform/platform-qnx.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698