Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/kernel.cfa

    r96bfdde7 r12daa43  
    1515
    1616#define __cforall_thread__
     17#define _GNU_SOURCE
     18
    1719// #define __CFA_DEBUG_PRINT_RUNTIME_CORE__
    1820
     
    278280
    279281                                // Spin a little on I/O, just in case
    280                                         for(5) {
     282                                for(5) {
    281283                                        __maybe_io_drain( this );
    282284                                        readyThread = pop_fast( this->cltr );
     
    285287
    286288                                // no luck, try stealing a few times
    287                                         for(5) {
     289                                for(5) {
    288290                                        if( __maybe_io_drain( this ) ) {
    289291                                                readyThread = pop_fast( this->cltr );
     
    422424                __cfactx_switch( &proc_cor->context, &thrd_dst->context );
    423425                // when __cfactx_switch returns we are back in the processor coroutine
     426
     427
    424428
    425429                /* paranoid */ verify( 0x0D15EA5E0D15EA5Ep == thrd_dst->canary );
     
    522526
    523527        /* paranoid */ verify( ! __preemption_enabled() );
    524         /* paranoid */ verifyf( ((uintptr_t)thrd_src->context.SP) < ((uintptr_t)__get_stack(thrd_src->curr_cor)->base ), "ERROR : Returning $thread %p has been corrupted.\n StackPointer too small.\n", thrd_src );
    525         /* paranoid */ verifyf( ((uintptr_t)thrd_src->context.SP) > ((uintptr_t)__get_stack(thrd_src->curr_cor)->limit), "ERROR : Returning $thread %p has been corrupted.\n StackPointer too large.\n", thrd_src );
     528        /* paranoid */ verifyf( ((uintptr_t)thrd_src->context.SP) < ((uintptr_t)__get_stack(thrd_src->curr_cor)->base ) || thrd_src->corctx_flag, "ERROR : Returning $thread %p has been corrupted.\n StackPointer too small.\n", thrd_src );
     529        /* paranoid */ verifyf( ((uintptr_t)thrd_src->context.SP) > ((uintptr_t)__get_stack(thrd_src->curr_cor)->limit) || thrd_src->corctx_flag, "ERROR : Returning $thread %p has been corrupted.\n StackPointer too large.\n", thrd_src );
    526530}
    527531
Note: See TracChangeset for help on using the changeset viewer.