Changeset 8512a2f for libcfa/src
- Timestamp:
- Mar 14, 2023, 3:51:03 PM (22 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 1950837
- Parents:
- 3830c84
- Location:
- libcfa/src
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/Makefile.am
r3830c84 r8512a2f 48 48 math.hfa \ 49 49 time_t.hfa \ 50 virtual_dtor.hfa \ 50 51 bits/algorithm.hfa \ 51 52 bits/align.hfa \ … … 68 69 vec/vec2.hfa \ 69 70 vec/vec3.hfa \ 70 vec/vec4.hfa 71 vec/vec4.hfa 71 72 72 73 inst_headers_src = \ -
libcfa/src/concurrency/actor.hfa
r3830c84 r8512a2f 5 5 #include <kernel.hfa> 6 6 #include <iofwd.hfa> 7 #include <virtual_dtor.hfa> 7 8 8 9 #ifdef __CFA_DEBUG__ … … 357 358 if ( seperate_clus ) delete( cluster ); 358 359 359 #ifdef STATS 360 #ifdef STATS // print formatted stats 360 361 printf(" Actor System Stats:\n"); 361 362 printf("\tActors Created:\t\t\t\t%lu\n\tMessages Sent:\t\t\t\t%lu\n", __num_actors_stats, __all_processed); … … 388 389 static executor * __actor_executor_ = 0p; 389 390 static bool __actor_executor_passed = false; // was an executor passed to start_actor_system 390 static size_t __num_actors_ = 0; // number of actor objects in system391 static size_t __num_actors_ = 0; // number of actor objects in system 391 392 static struct thread$ * __actor_executor_thd = 0p; // used to wake executor after actors finish 392 393 struct actor { 393 size_t ticket; // executor-queue handle394 size_t ticket; // executor-queue handle 394 395 Allocation allocation_; // allocation action 396 inline virtual_dtor; 395 397 }; 396 398 … … 406 408 #endif 407 409 } 408 static inline void ^?{}( actor & this ) {}409 410 410 411 static inline void check_actor( actor & this ) { … … 430 431 struct message { 431 432 Allocation allocation_; // allocation action 433 inline virtual_dtor; 432 434 }; 433 435 434 static inline void ?{}( message & this ) { this.allocation_ = Nodelete; } 436 static inline void ?{}( message & this ) { 437 this.allocation_ = Nodelete; 438 } 435 439 static inline void ?{}( message & this, Allocation allocation ) { 436 440 memcpy( &this.allocation_, &allocation, sizeof(allocation) ); // optimization to elide ctor 437 441 verifyf( this.allocation_ != Finished, "The Finished Allocation status is not supported for message types.\n"); 438 442 } 439 static inline void ^?{}( message & this ) {440 CFA_DEBUG( if ( this.allocation_ == Nodelete ) printf("A message at location %p was allocated but never sent.\n", &this); )443 static inline void ^?{}( message & this ) with(this) { 444 CFA_DEBUG( if ( allocation_ == Nodelete ) printf("A message at location %p was allocated but never sent.\n", &this); ) 441 445 } 442 446 443 447 static inline void check_message( message & this ) { 444 #ifdef __CFA_DEBUG__ 445 Allocation temp = this.allocation_; 446 this.allocation_ = Finished; 447 switch ( temp ) 448 #else 449 switch ( this.allocation_ ) 450 #endif 451 { // analyze message status 452 case Nodelete: break; 448 switch ( this.allocation_ ) { // analyze message status 449 case Nodelete: CFA_DEBUG(this.allocation_ = Finished); break; 453 450 case Delete: delete( &this ); break; 454 451 case Destroy: ^?{}(this); break; … … 456 453 } // switch 457 454 } 458 static inline void set_allocation( message & this, Allocation state ) { this.allocation_ = state; } 455 static inline void set_allocation( message & this, Allocation state ) { 456 this.allocation_ = state; 457 } 459 458 460 459 static inline void deliver_request( request & this ) { … … 688 687 Allocation receive( actor & this, __DestroyMsg & msg ) { return Destroy; } 689 688 Allocation receive( actor & this, __FinishedMsg & msg ) { return Finished; } 689
Note: See TracChangeset
for help on using the changeset viewer.