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

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

Issue 9112013: Thread pool changes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added tread pool shutdown 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/main.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 <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>
(...skipping 352 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++) {
377 thread_pool.InsertTask(i);
378 }
379 }
380 } 373 }
381 374
382 375
383 void EventHandlerImplementation::SendData(intptr_t id, 376 void EventHandlerImplementation::SendData(intptr_t id,
384 Dart_Port dart_port, 377 Dart_Port dart_port,
385 intptr_t data) { 378 intptr_t data) {
386 WakeupHandler(id, dart_port, data); 379 WakeupHandler(id, dart_port, data);
387 } 380 }
OLDNEW
« no previous file with comments | « runtime/bin/eventhandler_linux.h ('k') | runtime/bin/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698