Changeset 428adbc for libcfa/src
- Timestamp:
- Aug 10, 2022, 8:33:42 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation
- Children:
- 7f6a7c9
- Parents:
- 20be782
- Location:
- libcfa/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/bits/defs.hfa
r20be782 r428adbc 21 21 #include <stdint.h> 22 22 #include <assert.h> 23 23 #include <signal.h> 24 24 25 25 #define likely(x) __builtin_expect(!!(x), 1) … … 53 53 int real_pthread_attr_setstack( pthread_attr_t *attr, void *stackaddr, size_t stacksize ); 54 54 int real_pthread_attr_getstacksize( const pthread_attr_t *attr, size_t *stacksize ); 55 //int real_pthread_sigqueue(pthread_t _thread, int sig, const union sigval value);56 //int real_pthread_sigmask( int /* how */, const sigset_t * /* set */, sigset_t * /* oset */);55 int real_pthread_sigqueue(pthread_t _thread, int sig, const union sigval value); 56 int real_pthread_sigmask( int how, const sigset_t *set, sigset_t *oset); 57 57 } 58 58 #endif -
libcfa/src/concurrency/io.cfa
r20be782 r428adbc 610 610 if( we ) { 611 611 sigval_t value = { PREEMPT_IO }; 612 pthread_sigqueue(ctx->proc->kernel_thread, SIGUSR1, value);612 real_pthread_sigqueue(ctx->proc->kernel_thread, SIGUSR1, value); 613 613 } 614 614 -
libcfa/src/concurrency/io/setup.cfa
r20be782 r428adbc 337 337 // iopoll.run = false; 338 338 // sigval val = { 1 }; 339 // pthread_sigqueue( iopoll.thrd, SIGUSR1, val );339 // real_pthread_sigqueue( iopoll.thrd, SIGUSR1, val ); 340 340 341 341 // // Make sure all this is done -
libcfa/src/concurrency/preemption.cfa
r20be782 r428adbc 368 368 sigset_t oldset; 369 369 int ret; 370 ret = pthread_sigmask(0, ( const sigset_t * ) 0p, &oldset); // workaround trac#208: cast should be unnecessary370 ret = real_pthread_sigmask(0, ( const sigset_t * ) 0p, &oldset); // workaround trac#208: cast should be unnecessary 371 371 if(ret != 0) { abort("ERROR sigprocmask returned %d", ret); } 372 372 … … 401 401 sigaddset( &mask, sig ); 402 402 403 if ( pthread_sigmask( SIG_UNBLOCK, &mask, 0p ) == -1 ) {403 if ( real_pthread_sigmask( SIG_UNBLOCK, &mask, 0p ) == -1 ) { 404 404 abort( "internal error, pthread_sigmask" ); 405 405 } … … 412 412 sigaddset( &mask, sig ); 413 413 414 if ( pthread_sigmask( SIG_BLOCK, &mask, 0p ) == -1 ) {414 if ( real_pthread_sigmask( SIG_BLOCK, &mask, 0p ) == -1 ) { 415 415 abort( "internal error, pthread_sigmask" ); 416 416 } … … 420 420 static void preempt( processor * this ) { 421 421 sigval_t value = { PREEMPT_NORMAL }; 422 pthread_sigqueue( this->kernel_thread, SIGUSR1, value );422 real_pthread_sigqueue( this->kernel_thread, SIGUSR1, value ); 423 423 } 424 424 … … 431 431 sigset_t oldset; 432 432 int ret; 433 ret = pthread_sigmask(0, ( const sigset_t * ) 0p, &oldset); // workaround trac#208: cast should be unnecessary433 ret = real_pthread_sigmask(0, ( const sigset_t * ) 0p, &oldset); // workaround trac#208: cast should be unnecessary 434 434 if(ret != 0) { abort("ERROR sigprocmask returned %d", ret); } 435 435 … … 450 450 sigset_t oldset; 451 451 int ret; 452 ret = pthread_sigmask(0, ( const sigset_t * ) 0p, &oldset); // workaround trac#208: cast should be unnecessary452 ret = real_pthread_sigmask(0, ( const sigset_t * ) 0p, &oldset); // workaround trac#208: cast should be unnecessary 453 453 if(ret != 0) { abort("ERROR sigprocmask returned %d", ret); } 454 454 … … 608 608 sigval val; 609 609 val.sival_int = 0; 610 pthread_sigqueue( alarm_thread, SIGALRM, val );610 real_pthread_sigqueue( alarm_thread, SIGALRM, val ); 611 611 612 612 // Wait for the preemption thread to finish … … 682 682 static_assert( sizeof( sigset_t ) == sizeof( cxt->uc_sigmask ), "Expected cxt->uc_sigmask to be of sigset_t" ); 683 683 #endif 684 if ( pthread_sigmask( SIG_SETMASK, (sigset_t *)&(cxt->uc_sigmask), 0p ) == -1 ) {684 if ( real_pthread_sigmask( SIG_SETMASK, (sigset_t *)&(cxt->uc_sigmask), 0p ) == -1 ) { 685 685 abort( "internal error, sigprocmask" ); 686 686 } … … 710 710 sigset_t mask; 711 711 sigfillset(&mask); 712 if ( pthread_sigmask( SIG_BLOCK, &mask, 0p ) == -1 ) {712 if ( real_pthread_sigmask( SIG_BLOCK, &mask, 0p ) == -1 ) { 713 713 abort( "internal error, pthread_sigmask" ); 714 714 } -
libcfa/src/concurrency/pthread.cfa
r20be782 r428adbc 666 666 667 667 668 //int pthread_sigmask( int /* how */, const sigset_t * /* set */, sigset_t * /* oset */ ) libcfa_public __THROW {669 //return 0;670 //} // pthread_sigmask668 int pthread_sigmask( int /* how */, const sigset_t * /* set */, sigset_t * /* oset */ ) libcfa_public __THROW { 669 return 0; 670 } // pthread_sigmask 671 671 672 672 int pthread_kill( pthread_t _thread __attribute__(( unused )), int sig ) libcfa_public __THROW { … … 679 679 } // pthread_kill 680 680 681 //int pthread_sigqueue(pthread_t , int sig, const union sigval) libcfa_public __THROW {682 //return 0;683 //} // pthread_sigqueue681 int pthread_sigqueue(pthread_t , int sig, const union sigval) libcfa_public __THROW { 682 return 0; 683 } // pthread_sigqueue 684 684 685 685 //######################### Scheduling ######################### -
libcfa/src/interpose.cfa
r20be782 r428adbc 118 118 typeof(pthread_attr_destroy) pthread_attr_destroy; 119 119 typeof(pthread_attr_getstacksize) pthread_attr_getstacksize; 120 //typeof(pthread_sigmask) pthread_sigmask;121 //typeof(pthread_sigqueue) pthread_sigqueue;120 typeof(pthread_sigmask) pthread_sigmask; 121 typeof(pthread_sigqueue) pthread_sigqueue; 122 122 } __cabi_libc; 123 123 … … 142 142 INTERPOSE_LIBC( pthread_attr_setstack , version ); 143 143 INTERPOSE_LIBC( pthread_attr_getstacksize , version ); 144 //INTERPOSE_LIBC( pthread_sigmask , version );145 //INTERPOSE_LIBC( pthread_sigqueue , version );144 INTERPOSE_LIBC( pthread_sigmask , version ); 145 INTERPOSE_LIBC( pthread_sigqueue , version ); 146 146 #pragma GCC diagnostic pop 147 147 … … 229 229 return __cabi_libc.pthread_attr_getstacksize(attr, stacksize); 230 230 } 231 //libcfa_public int real_pthread_sigmask(int how, const sigset_t *set, sigset_t *oldset){232 //return __cabi_libc.pthread_sigmask(how, set, oldset);233 //}234 //libcfa_public int real_pthread_sigqueue(pthread_t _thread, int sig, const union sigval value){235 // return __cabi_libc.real_pthread_sigqueue(_thread, sig, value);236 //}231 libcfa_public int real_pthread_sigmask(int how, const sigset_t *set, sigset_t *oldset){ 232 return __cabi_libc.pthread_sigmask(how, set, oldset); 233 } 234 libcfa_public int real_pthread_sigqueue(pthread_t _thread, int sig, const union sigval value){ 235 return __cabi_libc.pthread_sigqueue(_thread, sig, value); 236 } 237 237 } 238 238
Note: See TracChangeset
for help on using the changeset viewer.