- File:
-
- 1 edited
-
libcfa/src/concurrency/preemption.cfa (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/preemption.cfa
r5a05946 r926d358 10 10 // Created On : Mon Jun 5 14:20:42 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jan 9 08:42:59 202313 // Update Count : 6012 // Last Modified On : Thu Feb 17 11:18:57 2022 13 // Update Count : 59 14 14 // 15 15 16 16 #define __cforall_thread__ 17 #define _GNU_SOURCE 17 18 18 19 // #define __CFA_DEBUG_PRINT_PREEMPTION__ … … 117 118 __cfadbg_print_buffer_decl( preemption, " KERNEL: preemption tick %lu\n", currtime.tn); 118 119 Duration period = node->period; 119 if( period == 0 ) {120 if( period == 0) { 120 121 node->set = false; // Node is one-shot, just mark it as not pending 121 122 } … … 351 352 sigset_t oldset; 352 353 int ret; 353 ret = __cfaabi_pthread_sigmask(0, ( const sigset_t * ) 0p, &oldset); // workaround trac#208: cast should be unnecessary354 ret = pthread_sigmask(0, ( const sigset_t * ) 0p, &oldset); // workaround trac#208: cast should be unnecessary 354 355 if(ret != 0) { abort("ERROR sigprocmask returned %d", ret); } 355 356 … … 384 385 sigaddset( &mask, sig ); 385 386 386 if ( __cfaabi_pthread_sigmask( SIG_UNBLOCK, &mask, 0p ) == -1 ) {387 if ( pthread_sigmask( SIG_UNBLOCK, &mask, 0p ) == -1 ) { 387 388 abort( "internal error, pthread_sigmask" ); 388 389 } … … 395 396 sigaddset( &mask, sig ); 396 397 397 if ( __cfaabi_pthread_sigmask( SIG_BLOCK, &mask, 0p ) == -1 ) {398 if ( pthread_sigmask( SIG_BLOCK, &mask, 0p ) == -1 ) { 398 399 abort( "internal error, pthread_sigmask" ); 399 400 } … … 403 404 static void preempt( processor * this ) { 404 405 sigval_t value = { PREEMPT_NORMAL }; 405 __cfaabi_pthread_sigqueue( this->kernel_thread, SIGUSR1, value );406 pthread_sigqueue( this->kernel_thread, SIGUSR1, value ); 406 407 } 407 408 … … 414 415 sigset_t oldset; 415 416 int ret; 416 ret = __cfaabi_pthread_sigmask(0, ( const sigset_t * ) 0p, &oldset); // workaround trac#208: cast should be unnecessary417 ret = pthread_sigmask(0, ( const sigset_t * ) 0p, &oldset); // workaround trac#208: cast should be unnecessary 417 418 if(ret != 0) { abort("ERROR sigprocmask returned %d", ret); } 418 419 … … 433 434 sigset_t oldset; 434 435 int ret; 435 ret = __cfaabi_pthread_sigmask(0, ( const sigset_t * ) 0p, &oldset); // workaround trac#208: cast should be unnecessary436 ret = pthread_sigmask(0, ( const sigset_t * ) 0p, &oldset); // workaround trac#208: cast should be unnecessary 436 437 if(ret != 0) { abort("ERROR sigprocmask returned %d", ret); } 437 438 … … 504 505 sigval val; 505 506 val.sival_int = 0; 506 __cfaabi_pthread_sigqueue( alarm_thread, SIGALRM, val );507 pthread_sigqueue( alarm_thread, SIGALRM, val ); 507 508 508 509 // Wait for the preemption thread to finish … … 578 579 static_assert( sizeof( sigset_t ) == sizeof( cxt->uc_sigmask ), "Expected cxt->uc_sigmask to be of sigset_t" ); 579 580 #endif 580 if ( __cfaabi_pthread_sigmask( SIG_SETMASK, (sigset_t *)&(cxt->uc_sigmask), 0p ) == -1 ) {581 if ( pthread_sigmask( SIG_SETMASK, (sigset_t *)&(cxt->uc_sigmask), 0p ) == -1 ) { 581 582 abort( "internal error, sigprocmask" ); 582 583 } … … 606 607 sigset_t mask; 607 608 sigfillset(&mask); 608 if ( __cfaabi_pthread_sigmask( SIG_BLOCK, &mask, 0p ) == -1 ) {609 if ( pthread_sigmask( SIG_BLOCK, &mask, 0p ) == -1 ) { 609 610 abort( "internal error, pthread_sigmask" ); 610 611 }
Note:
See TracChangeset
for help on using the changeset viewer.