source: tests/concurrency/actors/inherit.cfa@ 7592f42

Last change on this file since 7592f42 was 6a6e205, checked in by Michael Brooks <mlbrooks@…>, 10 months ago

Clean some warnings from unused variables and pointer-to-int casts.

  • Property mode set to 100644
File size: 1.1 KB
RevLine 
[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
8struct Server { inline actor; };
9
[f6fd22a4]10struct Server2 { inline Server; int b; };
[1950837]11void ^?{}( Server2 & this ) { mutex(sout) sout | 'A'; }
[f6fd22a4]12
13struct D_msg { int a; inline message; };
[1950837]14void ?{}( D_msg & this ) { set_allocation( this, Delete ); }
[bdf4cd9e]15void ^?{}( D_msg & ) { mutex(sout) sout | 'A'; }
[1950837]16
[f6fd22a4]17struct D_msg2 { inline D_msg; };
18
[c880a7b]19allocation handle() {
[7edf912]20 return Finished;
[1950837]21}
22
[6a6e205]23allocation receive( Server &, D_msg & ) { return handle(); }
24allocation receive( Server &, D_msg2 & ) { return handle(); }
25allocation receive( Server2 &, D_msg & ) { return Delete; }
26allocation receive( Server2 &, D_msg2 & ) { return Delete; }
[1950837]27
28int main() {
[7edf912]29 sout | "Start";
30 {
[41882628]31 actor_start();
[7edf912]32 D_msg * dm = alloc();
33 (*dm){};
34 D_msg2 * dm2 = alloc();
35 (*dm2){};
36 Server2 * s = alloc();
37 (*s){};
38 Server2 * s2 = alloc();
39 (*s2){};
40 *s | *dm;
41 *s2 | *dm2;
[41882628]42 actor_stop();
[7edf912]43 }
44 {
[41882628]45 actor_start();
[7edf912]46 Server s[2];
47 D_msg * dm = alloc();
48 (*dm){};
49 D_msg2 * dm2 = alloc();
50 (*dm2){};
51 s[0] | *dm;
52 s[1] | *dm2;
[41882628]53 actor_stop();
[7edf912]54 }
55 sout | "Finished";
56}
Note: See TracBrowser for help on using the repository browser.