Changeset deda7e6 for tests/concurrency/actors/inline.cfa
- Timestamp:
- Sep 21, 2023, 10:15:58 PM (2 years ago)
- Branches:
- master, stuck-waitfor-destruct
- Children:
- 62c6cfa
- Parents:
- c1e66d9 (diff), 5a1ae14 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
tests/concurrency/actors/inline.cfa (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrency/actors/inline.cfa
rc1e66d9 rdeda7e6 3 3 4 4 struct d_actor { 5 inline actor;5 inline actor; 6 6 }; 7 7 struct msg_wrapper { 8 int b;9 inline message;8 int b; 9 inline message; 10 10 }; 11 11 void ^?{}( msg_wrapper & this ) { sout | "msg_wrapper dtor"; } 12 12 13 13 struct d_msg { 14 int m;15 inline msg_wrapper;14 int m; 15 inline msg_wrapper; 16 16 }; 17 17 void ?{}( d_msg & this, int m, int b ) { this.m = m; this.b = b; set_allocation( this, Delete ); } … … 19 19 20 20 allocation receive( d_actor &, d_msg & msg ) { 21 sout | msg.m;22 sout | msg.b;23 return Finished;21 sout | msg.m; 22 sout | msg.b; 23 return Finished; 24 24 } 25 25 26 26 struct d_msg2 { 27 int m;28 inline msg_wrapper;27 int m; 28 inline msg_wrapper; 29 29 }; 30 30 void ^?{}( d_msg2 & this ) { sout | "d_msg2 dtor";} 31 31 32 32 allocation receive( d_actor &, d_msg2 & msg ) { 33 sout | msg.m;34 return Finished;33 sout | msg.m; 34 return Finished; 35 35 } 36 36 37 37 int main() { 38 processor p;39 {40 start_actor_system();// sets up executor41 d_actor da;42 d_msg * dm = alloc();43 (*dm){ 42, 2423 };44 da | *dm;45 stop_actor_system();// waits until actors finish46 }47 {48 start_actor_system();// sets up executor49 d_actor da;50 d_msg2 dm{ 29079 };51 set_allocation( dm, Nodelete );52 msg_wrapper * mw = &dm;53 message * mg = &dm;54 virtual_dtor * v = &dm;55 da | dm;56 stop_actor_system();// waits until actors finish57 }38 processor p; 39 { 40 start_actor_system(); // sets up executor 41 d_actor da; 42 d_msg * dm = alloc(); 43 (*dm){ 42, 2423 }; 44 da | *dm; 45 stop_actor_system(); // waits until actors finish 46 } 47 { 48 start_actor_system(); // sets up executor 49 d_actor da; 50 d_msg2 dm{ 29079 }; 51 set_allocation( dm, Nodelete ); 52 msg_wrapper * mw = &dm; 53 message * mg = &dm; 54 virtual_dtor * v = &dm; 55 da | dm; 56 stop_actor_system(); // waits until actors finish 57 } 58 58 }
Note:
See TracChangeset
for help on using the changeset viewer.