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

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

Issue 8497041: Tighten handling of pthread_create errors on Linux. (Closed)
Patch Set: Created 9 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 761
762 762
763 void Thread::Start() { 763 void Thread::Start() {
764 pthread_attr_t* attr_ptr = NULL; 764 pthread_attr_t* attr_ptr = NULL;
765 pthread_attr_t attr; 765 pthread_attr_t attr;
766 if (stack_size_ > 0) { 766 if (stack_size_ > 0) {
767 pthread_attr_init(&attr); 767 pthread_attr_init(&attr);
768 pthread_attr_setstacksize(&attr, static_cast<size_t>(stack_size_)); 768 pthread_attr_setstacksize(&attr, static_cast<size_t>(stack_size_));
769 attr_ptr = &attr; 769 attr_ptr = &attr;
770 } 770 }
771 pthread_create(&data_->thread_, attr_ptr, ThreadEntry, this); 771 int result = pthread_create(&data_->thread_, attr_ptr, ThreadEntry, this);
772 ASSERT(data_->thread_ != kNoThread); 772 CHECK_EQ(0, result);
Vitaly Repeshko 2011/11/09 19:03:47 Let's keep the assert.
773 } 773 }
774 774
775 775
776 void Thread::Join() { 776 void Thread::Join() {
777 pthread_join(data_->thread_, NULL); 777 pthread_join(data_->thread_, NULL);
778 } 778 }
779 779
780 780
781 Thread::LocalStorageKey Thread::CreateThreadLocalKey() { 781 Thread::LocalStorageKey Thread::CreateThreadLocalKey() {
782 pthread_key_t key; 782 pthread_key_t key;
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 1209
1210 1210
1211 void Sampler::Stop() { 1211 void Sampler::Stop() {
1212 ASSERT(IsActive()); 1212 ASSERT(IsActive());
1213 SignalSender::RemoveActiveSampler(this); 1213 SignalSender::RemoveActiveSampler(this);
1214 SetActive(false); 1214 SetActive(false);
1215 } 1215 }
1216 1216
1217 1217
1218 } } // namespace v8::internal 1218 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698