Ignore:
Timestamp:
Aug 30, 2022, 6:30:32 PM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, master, pthread-emulation
Children:
4858a88
Parents:
a8dd247 (diff), 01ba701 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

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

    ra8dd247 ra0dbf20  
    357357                        }
    358358                }
     359        }
     360
     361        // Check whether or not there is pending preemption
     362        // force_yield( __POLL_PREEMPTION ) if appropriate
     363        // return true if the thread was in an interruptable state
     364        // i.e. on a real processor and not in the kernel
     365        // (can return true even if no preemption was pending)
     366        bool poll_interrupts() libcfa_public {
     367                // Cache the processor now since interrupts can start happening after the atomic store
     368                processor   * proc = publicTLS_get( this_processor );
     369                if ( ! proc ) return false;
     370                if ( ! __preemption_enabled() ) return false;
     371
     372                with( __cfaabi_tls.preemption_state ){
     373                        // Signal the compiler that a fence is needed but only for signal handlers
     374                        __atomic_signal_fence(__ATOMIC_RELEASE);
     375                        if( proc->pending_preemption ) {
     376                                proc->pending_preemption = false;
     377                                force_yield( __POLL_PREEMPTION );
     378                        }
     379                }
     380
     381                return true;
    359382        }
    360383}
     
    643666// Kernel Signal Handlers
    644667//=============================================================================================
    645 __cfaabi_dbg_debug_do( static thread_local void * last_interrupt = 0; )
     668__cfaabi_dbg_debug_do( static _Thread_local void * last_interrupt = 0; )
    646669
    647670// Context switch signal handler
Note: See TracChangeset for help on using the changeset viewer.