Changes in / [b0f6190a:ec19b21]


Ignore:
Location:
libcfa/src/concurrency
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/io/setup.cfa

    rb0f6190a rec19b21  
    314314        }
    315315
    316         extern void signal_block( int sig );
    317         extern void signal_unblock( int sig );
    318 
    319316        static void __io_create( __io_data & this, const io_context_params & params_in ) {
    320317                // Step 1 : call to setup
     
    432429
    433430                // Step 4 : eventfd
    434                 // io_uring_register is so f*cking slow on some machine that it
    435                 // will never succeed if preemption isn't hard blocked
    436                 signal_block( SIGUSR1 );
    437 
    438                 int efd = eventfd(0, 0);
    439                 if (efd < 0) {
    440                         abort("KERNEL ERROR: IO_URING EVENTFD - %s\n", strerror(errno));
    441                 }
    442 
    443                 int ret = syscall( __NR_io_uring_register, fd, IORING_REGISTER_EVENTFD, &efd, 1);
    444                 if (ret < 0) {
    445                         abort("KERNEL ERROR: IO_URING EVENTFD REGISTER - %s\n", strerror(errno));
    446                 }
    447 
    448                 signal_unblock( SIGUSR1 );
     431                int efd;
     432                for() {
     433                        efd = eventfd(0, 0);
     434                        if (efd < 0) {
     435                                if (errno == EINTR) continue;
     436                                abort("KERNEL ERROR: IO_URING EVENTFD - %s\n", strerror(errno));
     437                        }
     438                        break;
     439                }
     440
     441                int ret;
     442                for() {
     443                        ret = syscall( __NR_io_uring_register, fd, IORING_REGISTER_EVENTFD, &efd, 1);
     444                        if (ret < 0) {
     445                                if (errno == EINTR) continue;
     446                                abort("KERNEL ERROR: IO_URING EVENTFD REGISTER - %s\n", strerror(errno));
     447                        }
     448                        break;
     449                }
    449450
    450451                // some paranoid checks
  • libcfa/src/concurrency/preemption.cfa

    rb0f6190a rec19b21  
    394394
    395395// sigprocmask wrapper : unblock a single signal
    396 void signal_unblock( int sig ) {
     396static inline void signal_unblock( int sig ) {
    397397        sigset_t mask;
    398398        sigemptyset( &mask );
     
    405405
    406406// sigprocmask wrapper : block a single signal
    407 void signal_block( int sig ) {
     407static inline void signal_block( int sig ) {
    408408        sigset_t mask;
    409409        sigemptyset( &mask );
Note: See TracChangeset for help on using the changeset viewer.