 Chromium Code Reviews
 Chromium Code Reviews Issue 27215002:
  Very simple version of Isolates.  (Closed) 
  Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
    
  
    Issue 27215002:
  Very simple version of Isolates.  (Closed) 
  Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart| Index: runtime/bin/io_service_patch.dart | 
| diff --git a/runtime/bin/io_service_patch.dart b/runtime/bin/io_service_patch.dart | 
| index c6a703529cf9fd67fe50451879e337ca6c48ae44..85f51241acd4ffb4894c33a5e665f34c5ca23d41 100644 | 
| --- a/runtime/bin/io_service_patch.dart | 
| +++ b/runtime/bin/io_service_patch.dart | 
| @@ -6,7 +6,7 @@ patch class _IOService { | 
| // Lazy initialize service ports, 32 per isolate. | 
| static const int _SERVICE_PORT_COUNT = 32; | 
| static List<SendPort> _servicePort = new List(_SERVICE_PORT_COUNT); | 
| - static ReceivePort _receivePort; | 
| + static RawReceivePort _receivePort; | 
| static SendPort _replyToPort; | 
| static Map<int, Completer> _messageMap = {}; | 
| static int _id = 0; | 
| @@ -29,9 +29,9 @@ patch class _IOService { | 
| _servicePort[index] = _newServicePort(); | 
| } | 
| if (_receivePort == null) { | 
| - _receivePort = new ReceivePort(); | 
| - _replyToPort = _receivePort.toSendPort(); | 
| - _receivePort.receive((data, _) { | 
| + _receivePort = new RawReceivePort(); | 
| + _replyToPort = _receivePort.sendPort; | 
| + _receivePort.handler = (data) { | 
| 
Lasse Reichstein Nielsen
2013/10/25 09:42:49
Better! :)
 
floitsch
2013/10/25 13:11:01
.
 | 
| assert(data is List && data.length == 2); | 
| _messageMap.remove(data[0]).complete(data[1]); | 
| if (_messageMap.length == 0) { | 
| @@ -39,7 +39,7 @@ patch class _IOService { | 
| _receivePort.close(); | 
| _receivePort = null; | 
| } | 
| - }); | 
| + }; | 
| } | 
| } |