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

Side by Side Diff: platform/thread_linux.cc

Issue 10535066: 1. Remove recursion during snapshot writing and reading (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 6 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 | platform/thread_macos.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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/thread.h" 5 #include "platform/thread.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <sys/time.h> 8 #include <sys/time.h>
9 9
10 #include "platform/assert.h" 10 #include "platform/assert.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 80
81 81
82 int Thread::Start(ThreadStartFunction function, uword parameter) { 82 int Thread::Start(ThreadStartFunction function, uword parameter) {
83 pthread_attr_t attr; 83 pthread_attr_t attr;
84 int result = pthread_attr_init(&attr); 84 int result = pthread_attr_init(&attr);
85 RETURN_ON_PTHREAD_FAILURE(result); 85 RETURN_ON_PTHREAD_FAILURE(result);
86 86
87 result = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); 87 result = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
88 RETURN_ON_PTHREAD_FAILURE(result); 88 RETURN_ON_PTHREAD_FAILURE(result);
89 89
90 result = pthread_attr_setstacksize(&attr, 1024 * KB); 90 result = pthread_attr_setstacksize(&attr, 64 * KB);
91 RETURN_ON_PTHREAD_FAILURE(result); 91 RETURN_ON_PTHREAD_FAILURE(result);
92 92
93 ThreadStartData* data = new ThreadStartData(function, parameter); 93 ThreadStartData* data = new ThreadStartData(function, parameter);
94 94
95 pthread_t tid; 95 pthread_t tid;
96 result = pthread_create(&tid, &attr, ThreadStart, data); 96 result = pthread_create(&tid, &attr, ThreadStart, data);
97 RETURN_ON_PTHREAD_FAILURE(result); 97 RETURN_ON_PTHREAD_FAILURE(result);
98 98
99 result = pthread_attr_destroy(&attr); 99 result = pthread_attr_destroy(&attr);
100 RETURN_ON_PTHREAD_FAILURE(result); 100 RETURN_ON_PTHREAD_FAILURE(result);
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 } 266 }
267 267
268 268
269 void Monitor::NotifyAll() { 269 void Monitor::NotifyAll() {
270 // TODO(iposva): Do we need to track lock owners? 270 // TODO(iposva): Do we need to track lock owners?
271 int result = pthread_cond_broadcast(data_.cond()); 271 int result = pthread_cond_broadcast(data_.cond());
272 VALIDATE_PTHREAD_RESULT(result); 272 VALIDATE_PTHREAD_RESULT(result);
273 } 273 }
274 274
275 } // namespace dart 275 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | platform/thread_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698