Last change
on this file since f6fd22a4 was
f6fd22a4,
checked in by caparsons <caparson@…>, 17 months ago
|
refactored inherit test to avoid base ctor call bug
|
-
Property mode set to
100644
|
File size:
1.4 KB
|
Rev | Line | |
---|
[1950837] | 1 | #include <actor.hfa> |
---|
| 2 | #include <fstream.hfa> |
---|
| 3 | #include <stdlib.hfa> |
---|
| 4 | #include <string.h> |
---|
| 5 | #include <stdio.h> |
---|
| 6 | #include <mutex_stmt.hfa> |
---|
| 7 | |
---|
| 8 | struct Server { inline actor; }; |
---|
| 9 | |
---|
[f6fd22a4] | 10 | struct Server2 { inline Server; int b; }; |
---|
[1950837] | 11 | void ^?{}( Server2 & this ) { mutex(sout) sout | 'A'; } |
---|
[f6fd22a4] | 12 | |
---|
| 13 | struct D_msg { int a; inline message; }; |
---|
[1950837] | 14 | void ?{}( D_msg & this ) { set_allocation( this, Delete ); } |
---|
| 15 | void ^?{}( D_msg & this ) { mutex(sout) sout | 'A'; } |
---|
| 16 | |
---|
[f6fd22a4] | 17 | struct D_msg2 { inline D_msg; }; |
---|
| 18 | |
---|
[c880a7b] | 19 | allocation handle() { |
---|
[1950837] | 20 | return Finished; |
---|
| 21 | } |
---|
| 22 | |
---|
[c880a7b] | 23 | allocation receive( Server & receiver, D_msg & msg ) { return handle(); } |
---|
| 24 | allocation receive( Server & receiver, D_msg2 & msg ) { return handle(); } |
---|
| 25 | allocation receive( Server2 & receiver, D_msg & msg ) { return Delete; } |
---|
| 26 | allocation receive( Server2 & receiver, D_msg2 & msg ) { return Delete; } |
---|
[1950837] | 27 | |
---|
| 28 | int main() { |
---|
| 29 | sout | "Start"; |
---|
| 30 | { |
---|
| 31 | start_actor_system(); |
---|
| 32 | D_msg * dm = alloc(); |
---|
| 33 | (*dm){}; |
---|
[f6fd22a4] | 34 | D_msg2 * dm2 = alloc(); |
---|
| 35 | (*dm2){}; |
---|
[1950837] | 36 | Server2 * s = alloc(); |
---|
| 37 | (*s){}; |
---|
| 38 | Server2 * s2 = alloc(); |
---|
| 39 | (*s2){}; |
---|
| 40 | *s << *dm; |
---|
[f6fd22a4] | 41 | *s2 << *dm2; |
---|
[1950837] | 42 | stop_actor_system(); |
---|
| 43 | } |
---|
| 44 | { |
---|
| 45 | start_actor_system(); |
---|
| 46 | Server s[2]; |
---|
| 47 | D_msg * dm = alloc(); |
---|
| 48 | (*dm){}; |
---|
[f6fd22a4] | 49 | D_msg2 * dm2 = alloc(); |
---|
| 50 | (*dm2){}; |
---|
[1950837] | 51 | s[0] << *dm; |
---|
[f6fd22a4] | 52 | s[1] << *dm2; |
---|
[1950837] | 53 | stop_actor_system(); |
---|
| 54 | } |
---|
| 55 | sout | "Finished"; |
---|
| 56 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.