- File:
-
- 1 edited
-
libcfa/src/concurrency/monitor.cfa (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/monitor.cfa
r09f357ec r2026bb6 10 10 // Created On : Thd Feb 23 12:27:26 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Dec 4 07:55:14 201913 // Update Count : 1012 // Last Modified On : Fri Mar 30 14:30:26 2018 13 // Update Count : 9 14 14 // 15 15 … … 243 243 // last routine called by a thread. 244 244 // Should never return 245 void __leave_thread_monitor() { 246 thread_desc * thrd = TL_GET( this_thread ); 245 void __leave_thread_monitor( thread_desc * thrd ) { 247 246 monitor_desc * this = &thrd->self_mon; 248 247 … … 364 363 this.waiting_thread = waiting_thread; 365 364 this.count = count; 366 this.next = 0p;365 this.next = NULL; 367 366 this.user_info = user_info; 368 367 } … … 370 369 void ?{}(__condition_criterion_t & this ) with( this ) { 371 370 ready = false; 372 target = 0p;373 owner = 0p;374 next = 0p;371 target = NULL; 372 owner = NULL; 373 next = NULL; 375 374 } 376 375 … … 379 378 this.target = target; 380 379 this.owner = &owner; 381 this.next = 0p;380 this.next = NULL; 382 381 } 383 382 … … 388 387 389 388 // Check that everything is as expected 390 assertf( this.monitors != 0p, "Waiting with no monitors (%p)", this.monitors );389 assertf( this.monitors != NULL, "Waiting with no monitors (%p)", this.monitors ); 391 390 verifyf( this.monitor_count != 0, "Waiting with 0 monitors (%"PRIiFAST16")", this.monitor_count ); 392 391 verifyf( this.monitor_count < 32u, "Excessive monitor count (%"PRIiFAST16")", this.monitor_count ); … … 450 449 451 450 // Lock all monitors 452 lock_all( this.monitors, 0p, count );451 lock_all( this.monitors, NULL, count ); 453 452 454 453 //Pop the head of the waiting queue … … 472 471 473 472 //Check that everything is as expected 474 verifyf( this.monitors != 0p, "Waiting with no monitors (%p)", this.monitors );473 verifyf( this.monitors != NULL, "Waiting with no monitors (%p)", this.monitors ); 475 474 verifyf( this.monitor_count != 0, "Waiting with 0 monitors (%"PRIiFAST16")", this.monitor_count ); 476 475 … … 675 674 676 675 static inline void reset_mask( monitor_desc * this ) { 677 this->mask.accepted = 0p;678 this->mask.data = 0p;676 this->mask.accepted = NULL; 677 this->mask.data = NULL; 679 678 this->mask.size = 0; 680 679 } … … 817 816 } 818 817 819 __cfaabi_dbg_print_safe( "Kernel : Runing %i (%p)\n", ready2run, ready2run ? node->waiting_thread : 0p);820 return ready2run ? node->waiting_thread : 0p;818 __cfaabi_dbg_print_safe( "Kernel : Runing %i (%p)\n", ready2run, ready2run ? node->waiting_thread : NULL ); 819 return ready2run ? node->waiting_thread : NULL; 821 820 } 822 821 … … 825 824 if( !this.monitors ) { 826 825 // __cfaabi_dbg_print_safe( "Branding\n" ); 827 assertf( thrd->monitors.data != 0p, "No current monitor to brand condition %p", thrd->monitors.data );826 assertf( thrd->monitors.data != NULL, "No current monitor to brand condition %p", thrd->monitors.data ); 828 827 this.monitor_count = thrd->monitors.size; 829 828
Note:
See TracChangeset
for help on using the changeset viewer.