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

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

Issue 351683009: Remove remaining dependencies on allocation.h from a few platform files (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 | « no previous file | 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 // 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 <dlfcn.h> 9 #include <dlfcn.h>
10 #include <errno.h> 10 #include <errno.h>
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 485
486 void OS::StrNCpy(char* dest, int length, const char* src, size_t n) { 486 void OS::StrNCpy(char* dest, int length, const char* src, size_t n) {
487 strncpy(dest, src, n); 487 strncpy(dest, src, n);
488 } 488 }
489 489
490 490
491 // ---------------------------------------------------------------------------- 491 // ----------------------------------------------------------------------------
492 // POSIX thread support. 492 // POSIX thread support.
493 // 493 //
494 494
495 class Thread::PlatformData : public Malloced { 495 class Thread::PlatformData {
496 public: 496 public:
497 PlatformData() : thread_(kNoThread) {} 497 PlatformData() : thread_(kNoThread) {}
498 pthread_t thread_; // Thread handle for pthread. 498 pthread_t thread_; // Thread handle for pthread.
499 // Synchronizes thread creation 499 // Synchronizes thread creation
500 Mutex thread_creation_mutex_; 500 Mutex thread_creation_mutex_;
501 }; 501 };
502 502
503 Thread::Thread(const Options& options) 503 Thread::Thread(const Options& options)
504 : data_(new PlatformData), 504 : data_(new PlatformData),
505 stack_size_(options.stack_size()), 505 stack_size_(options.stack_size()),
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 717
718 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { 718 void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
719 pthread_key_t pthread_key = LocalKeyToPthreadKey(key); 719 pthread_key_t pthread_key = LocalKeyToPthreadKey(key);
720 int result = pthread_setspecific(pthread_key, value); 720 int result = pthread_setspecific(pthread_key, value);
721 ASSERT_EQ(0, result); 721 ASSERT_EQ(0, result);
722 USE(result); 722 USE(result);
723 } 723 }
724 724
725 725
726 } } // namespace v8::internal 726 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/platform-win32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698