|
1 namespace mozilla { |
|
2 namespace _ipdltest { |
|
3 |
|
4 intr protocol PTestRaceDeferral { |
|
5 parent: |
|
6 intr Lose(); |
|
7 |
|
8 child: |
|
9 async StartRace(); |
|
10 intr Win(); |
|
11 intr Rpc(); |
|
12 async __delete__(); |
|
13 |
|
14 // Test that messages deferred due to race resolution are |
|
15 // re-considered when the winner makes later RPCs |
|
16 |
|
17 // IPDL's type system can't express this protocol because the race |
|
18 // resolution causes state to diverge for multiple steps, so we'll |
|
19 // leave it "stateless" |
|
20 /* |
|
21 state START: |
|
22 send StartRace goto DEFER; |
|
23 state DEFER: |
|
24 call Win goto PARENT; |
|
25 answer Lose goto CHILD; |
|
26 |
|
27 state PARENT: |
|
28 // 'Lose' is received here but deferred |
|
29 call Rpc goto PARENT_LOSE; |
|
30 state PARENT_LOSE: |
|
31 // Calling 'Rpc' undefers 'Lose', and it wins the "race" with 'Rpc' |
|
32 answer Lose goto DONE; |
|
33 |
|
34 state CHILD: |
|
35 call Win goto CHILD_RPC; |
|
36 state CHILD_RPC: |
|
37 call Rpc goto DONE; |
|
38 |
|
39 state DONE: |
|
40 send __delete__; |
|
41 */ |
|
42 }; |
|
43 |
|
44 } // namespace _ipdltest |
|
45 } // namespace mozilla |