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

Side by Side Diff: runtime/bin/eventhandler_linux.cc

Issue 8983017: Start of thread pool implementation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from ager@ Created 8 years, 11 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 | « runtime/bin/eventhandler_linux.h ('k') | runtime/bin/thread_pool.h » ('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) 2011, 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 <errno.h> 5 #include <errno.h>
6 #include <poll.h> 6 #include <poll.h>
7 #include <pthread.h> 7 #include <pthread.h>
8 #include <stdio.h> 8 #include <stdio.h>
9 #include <string.h> 9 #include <string.h>
10 #include <sys/time.h> 10 #include <sys/time.h>
11 #include <unistd.h> 11 #include <unistd.h>
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 363
364 void EventHandlerImplementation::StartEventHandler() { 364 void EventHandlerImplementation::StartEventHandler() {
365 pthread_t handler_thread; 365 pthread_t handler_thread;
366 int result = pthread_create(&handler_thread, 366 int result = pthread_create(&handler_thread,
367 NULL, 367 NULL,
368 &EventHandlerImplementation::Poll, 368 &EventHandlerImplementation::Poll,
369 this); 369 this);
370 if (result != 0) { 370 if (result != 0) {
371 FATAL("Create start event handler thread"); 371 FATAL("Create start event handler thread");
372 } 372 }
373
374 if (Dart_IsVMFlagSet("enable_thread_pool")) {
375 thread_pool.Start();
376 for (int i = 0; i < 100; i++) {
Ivan Posva 2012/01/04 17:26:34 This is non-sensical. Please make this into a prop
377 thread_pool.InsertTask(i);
378 }
379 }
373 } 380 }
374 381
375 382
376 void EventHandlerImplementation::SendData(intptr_t id, 383 void EventHandlerImplementation::SendData(intptr_t id,
377 Dart_Port dart_port, 384 Dart_Port dart_port,
378 intptr_t data) { 385 intptr_t data) {
379 WakeupHandler(id, dart_port, data); 386 WakeupHandler(id, dart_port, data);
380 } 387 }
OLDNEW
« no previous file with comments | « runtime/bin/eventhandler_linux.h ('k') | runtime/bin/thread_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698