ADTast-experimental
Last change
on this file since e54b4e9 was
858350a,
checked in by caparsons <caparson@…>, 21 months ago
|
added poison pill messages and made test for them
|
-
Property mode set to
100644
|
File size:
710 bytes
|
Rev | Line | |
---|
[858350a] | 1 | #include <actor.hfa> |
---|
| 2 | #include <fstream.hfa> |
---|
| 3 | #include <stdlib.hfa> |
---|
| 4 | #include <string.h> |
---|
| 5 | #include <stdio.h> |
---|
| 6 | |
---|
| 7 | struct Server { inline actor; }; |
---|
| 8 | |
---|
| 9 | int main() { |
---|
| 10 | sout | "Start"; |
---|
| 11 | |
---|
| 12 | sout | "Finished"; |
---|
| 13 | { |
---|
| 14 | start_actor_system(); |
---|
| 15 | Server s[10]; |
---|
| 16 | for ( i; 10 ) { |
---|
| 17 | s[i] << FinishedMsg; |
---|
| 18 | } |
---|
| 19 | stop_actor_system(); |
---|
| 20 | } |
---|
| 21 | |
---|
| 22 | sout | "Delete"; |
---|
| 23 | { |
---|
| 24 | start_actor_system(); |
---|
| 25 | for ( i; 10 ) { |
---|
| 26 | Server * s = alloc(); |
---|
| 27 | (*s){}; |
---|
| 28 | (*s) << DeleteMsg; |
---|
| 29 | } |
---|
| 30 | stop_actor_system(); |
---|
| 31 | } |
---|
| 32 | |
---|
| 33 | sout | "Destroy"; |
---|
| 34 | { |
---|
| 35 | start_actor_system(); |
---|
| 36 | Server s[10]; |
---|
| 37 | for ( i; 10 ) { |
---|
| 38 | s[i] << DestroyMsg; |
---|
| 39 | } |
---|
| 40 | stop_actor_system(); |
---|
| 41 | } |
---|
| 42 | |
---|
| 43 | sout | "Done"; |
---|
| 44 | return 0; |
---|
| 45 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.