- Timestamp:
- Mar 14, 2023, 3:52:34 PM (21 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 5217569
- Parents:
- 8512a2f
- Location:
- tests/concurrent/actors
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrent/actors/executor.cfa
r8512a2f r1950837 15 15 }; 16 16 void ?{}( d_actor & this ) with(this) { 17 ((actor &)this){};18 17 id = ids++; 19 18 gstart = (&this + (id / Set * Set - id)); // remember group-start array-element -
tests/concurrent/actors/poison.cfa
r8512a2f r1950837 5 5 #include <stdio.h> 6 6 7 struct Server { inline actor; }; 7 struct Server { int val; inline actor; }; 8 9 void ?{}( Server & this ) { this.val = 999; } 10 void ^?{}( Server & this ) { this.val = 777; } 8 11 9 12 int main() { … … 12 15 sout | "Finished"; 13 16 { 14 start_actor_system();15 Server s[10];16 for ( i; 10 ) {17 s[i] << FinishedMsg;18 }19 stop_actor_system();17 start_actor_system(); 18 Server s[10]; 19 for ( i; 10 ) { 20 s[i] << FinishedMsg; 21 } 22 stop_actor_system(); 20 23 } 21 24 22 25 sout | "Delete"; 23 26 { 24 start_actor_system();25 for ( i; 10 ) {26 Server * s = alloc();27 (*s){};28 (*s) << DeleteMsg;29 }30 stop_actor_system();27 start_actor_system(); 28 for ( i; 10 ) { 29 Server * s = alloc(); 30 (*s){}; 31 (*s) << DeleteMsg; 32 } 33 stop_actor_system(); 31 34 } 32 35 33 36 sout | "Destroy"; 34 37 { 35 start_actor_system(); 36 Server s[10]; 37 for ( i; 10 ) { 38 s[i] << DestroyMsg; 39 } 40 stop_actor_system(); 38 start_actor_system(); 39 Server s[10]; 40 for ( i; 10 ) 41 s[i] << DestroyMsg; 42 stop_actor_system(); 43 for ( i; 10 ) 44 if (s[i].val != 777) 45 sout | "Error: dtor not called correctly."; 41 46 } 42 47
Note: See TracChangeset
for help on using the changeset viewer.