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