Changeset 105fb21
- Timestamp:
- Nov 11, 2024, 10:29:15 PM (10 days ago)
- Branches:
- master
- Children:
- 41882628
- Parents:
- 7e943e1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/actor.hfa
r7e943e1 r105fb21 398 398 // TODO: update globals in this file to be static fields once the static fields project is done 399 399 static executor * __actor_executor_ = 0p; 400 static bool __actor_executor_passed = false; // was an executor passed to start_actor_system400 static bool __actor_executor_passed = false; // was an executor passed to actor_start 401 401 static size_t __num_actors_ = 0; // number of actor objects in system 402 402 static struct thread$ * __actor_executor_thd = 0p; // used to wake executor after actors finish … … 410 410 // Once an actor is allocated it must be sent a message or the actor system cannot stop. Hence, its receive 411 411 // member must be called to end it 412 DEBUG_ABORT( __actor_executor_ == 0p, "Creating actor before calling start_actor_system() can cause undefined behaviour.\n" );412 DEBUG_ABORT( __actor_executor_ == 0p, "Creating actor before calling actor_start() can cause undefined behaviour.\n" ); 413 413 alloc = Nodelete; 414 414 ticket = __get_next_ticket( *__actor_executor_ ); … … 682 682 } 683 683 684 static inline void start_actor_system( size_t num_thds ) {684 static inline void actor_start( size_t num_thds ) { 685 685 __reset_stats(); 686 686 __actor_executor_thd = active_thread(); … … 689 689 } 690 690 691 static inline void start_actor_system() { start_actor_system( get_proc_count( *active_cluster() ) ); }692 693 static inline void start_actor_system( executor & this ) {691 static inline void actor_start() { actor_start( get_proc_count( *active_cluster() ) ); } 692 693 static inline void actor_start( executor & this ) { 694 694 __reset_stats(); 695 695 __actor_executor_thd = active_thread(); … … 698 698 } 699 699 700 static inline void stop_actor_system() {700 static inline void actor_stop() { 701 701 park(); // unparked when actor system is finished 702 702 … … 715 715 struct finished_msg_t { inline message; } finished_msg = __base_msg_finished; 716 716 717 allocation receive( actor & this, delete_msg_t & msg) { return Delete; }718 allocation receive( actor & this, destroy_msg_t & msg) { return Destroy; }719 allocation receive( actor & this, finished_msg_t & msg) { return Finished; }717 allocation receive( actor & this, delete_msg_t & ) { return Delete; } 718 allocation receive( actor & this, destroy_msg_t & ) { return Destroy; } 719 allocation receive( actor & this, finished_msg_t & ) { return Finished; } 720 720 721 721 // Default messages used all the time. 722 //static struct startmsg_t { inline message; } start_msg; // start actor723 //static struct stopmsg_t { inline message; } stop_msg; // terminate actor722 struct start_msg_t { inline message; } start_msg = __base_msg_finished; // start actor 723 struct stop_msg_t { inline message; } stop_msg = __base_msg_finished; // terminate actor
Note: See TracChangeset
for help on using the changeset viewer.