Changeset 858350a for libcfa/src


Ignore:
Timestamp:
Mar 4, 2023, 2:58:57 PM (20 months ago)
Author:
caparsons <caparson@…>
Branches:
ADT, ast-experimental, master
Children:
4933f18
Parents:
2856044a
Message:

added poison pill messages and made test for them

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/actor.hfa

    r2856044a r858350a  
    662662
    663663// Default messages to send to any actor to change status
    664 // struct __DeleteMsg { inline message; } DeleteMsg;
    665 // void ?{}( __DeleteMsg & this ) { ((message &) this){ Finished }; }
    666 // struct __DestroyMsg { inline message; } DestroyMsg;
    667 // void ?{}( __DestroyMsg & this ) { ((message &) this){ Finished }; }
    668 // struct __FinishedMsg { inline message; } FinishedMsg;
    669 // void ?{}( __FinishedMsg & this ) { ((message &) this){ Finished }; }
    670 
    671 // Allocation receive( actor & this, __DeleteMsg & msg ) { return Delete; }
    672 // Allocation receive( actor & this, __DestroyMsg & msg ) { return Destroy; }
    673 // Allocation receive( actor & this, __FinishedMsg & msg ) { return Finished; }
     664// assigned at creation to __base_msg_finished to avoid unused message warning
     665message __base_msg_finished @= { .allocation_ : Finished };
     666struct __DeleteMsg { inline message; } DeleteMsg = __base_msg_finished;
     667struct __DestroyMsg { inline message; } DestroyMsg = __base_msg_finished;
     668struct __FinishedMsg { inline message; } FinishedMsg = __base_msg_finished;
     669void ?{}( __DeleteMsg & this, Allocation status ) { ((message &) this){ status }; }
     670void ?{}( __DestroyMsg & this, Allocation status ) { ((message &) this){ status }; }
     671void ?{}( __FinishedMsg & this, Allocation status ) { ((message &) this){ status }; }
     672
     673Allocation receive( actor & this, __DeleteMsg & msg ) { return Delete; }
     674Allocation receive( actor & this, __DestroyMsg & msg ) { return Destroy; }
     675Allocation receive( actor & this, __FinishedMsg & msg ) { return Finished; }
Note: See TracChangeset for help on using the changeset viewer.