| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 <errno.h> | 5 #include <errno.h> |
| 6 #include <sys/time.h> | 6 #include <sys/time.h> |
| 7 | 7 |
| 8 #include "vm/thread.h" | 8 #include "vm/thread.h" |
| 9 | 9 |
| 10 #include "vm/assert.h" | 10 #include "vm/assert.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 | 76 |
| 77 Thread::Thread(ThreadStartFunction function, uword parameter) { | 77 Thread::Thread(ThreadStartFunction function, uword parameter) { |
| 78 pthread_attr_t attr; | 78 pthread_attr_t attr; |
| 79 int result = pthread_attr_init(&attr); | 79 int result = pthread_attr_init(&attr); |
| 80 VALIDATE_PTHREAD_RESULT(result); | 80 VALIDATE_PTHREAD_RESULT(result); |
| 81 | 81 |
| 82 result = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); | 82 result = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); |
| 83 VALIDATE_PTHREAD_RESULT(result); | 83 VALIDATE_PTHREAD_RESULT(result); |
| 84 | 84 |
| 85 result = pthread_attr_setstacksize(&attr, 32 * KB); | 85 result = pthread_attr_setstacksize(&attr, 1024 * KB); |
| 86 VALIDATE_PTHREAD_RESULT(result); | 86 VALIDATE_PTHREAD_RESULT(result); |
| 87 | 87 |
| 88 ThreadStartData* data = new ThreadStartData(function, parameter, this); | 88 ThreadStartData* data = new ThreadStartData(function, parameter, this); |
| 89 | 89 |
| 90 pthread_t tid; | 90 pthread_t tid; |
| 91 result = pthread_create(&tid, | 91 result = pthread_create(&tid, |
| 92 &attr, | 92 &attr, |
| 93 ThreadStart, | 93 ThreadStart, |
| 94 data); | 94 data); |
| 95 VALIDATE_PTHREAD_RESULT(result); | 95 VALIDATE_PTHREAD_RESULT(result); |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 } | 232 } |
| 233 | 233 |
| 234 | 234 |
| 235 void Monitor::NotifyAll() { | 235 void Monitor::NotifyAll() { |
| 236 // TODO(iposva): Do we need to track lock owners? | 236 // TODO(iposva): Do we need to track lock owners? |
| 237 int result = pthread_cond_broadcast(data_.cond()); | 237 int result = pthread_cond_broadcast(data_.cond()); |
| 238 VALIDATE_PTHREAD_RESULT(result); | 238 VALIDATE_PTHREAD_RESULT(result); |
| 239 } | 239 } |
| 240 | 240 |
| 241 } // namespace dart | 241 } // namespace dart |
| OLD | NEW |