DescriptionAdd a mid-sized integration test for the Dart Embedding Api which
demonstrates how to create a custom isolate abstraction. In this
test, we use an event queue to share a single thread among our custom
isolates.
Add a callback which allows embedders to see when a port is created.
Not sure if I should keep this or not.
New apis:
Dart_CreatePort() -- allocates a port id and adds a port->isolate mapping.
Dart_IsolateHasActivePorts() -- does the current isolate have open ports?
(this name a bit awkward...)
Bail out of PortMap::ClosePorts() early if there are no open ports.
This suppresses calls to the close_port_callback when there are no
open ports.
Use DART_CHECK_VALID to provide better error output when the test lib
has errors.
-------------------------
Sample output of the test:
-- (isolate=0x815600) Constructing isolate
-- Enter: CustomIsolateImpl_start --
-- Adding port (7111) -> isolate (0x830800) --
-- Adding StartEvent to queue --
-- Exit: CustomIsolateImpl_start --
-- Adding port (7112) -> isolate (0x815600) --
-- Posting message dest(7111) reply(0) --
-- Adding MessageEvent to queue --
-- Starting event loop --
>> StartEvent with isolate(0x830800)--
-- (isolate=0x830800) Running isolateMain
$$ MessageEvent with dest port 7111--
-- (isolate=0x830800) Received: 42
-- Posting message dest(7112) reply(0) --
-- Adding MessageEvent to queue --
$$ MessageEvent with dest port 7112--
-- Closing port (7112) --
-- Adding ShutdownEvent to queue --
-- (isolate=0x815600) Received: 43
<< ShutdownEvent with isolate(0x815600)--
-- Finished event loop --
Committed: https://code.google.com/p/dart/source/detail?r=1906
Patch Set 1 #
Total comments: 7
Patch Set 2 : '' #Patch Set 3 : '' #
Total comments: 8
Patch Set 4 : '' #
Total comments: 16
Patch Set 5 : '' #Patch Set 6 : '' #
Total comments: 12
Patch Set 7 : '' #
Messages
Total messages: 12 (0 generated)
|