Changeset 13fdf86 for libcfa


Ignore:
Timestamp:
Mar 2, 2022, 4:23:43 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
Children:
1860885
Parents:
a494d105
Message:

Moved preemption reason to kernel_private and added preempt IO.

Location:
libcfa/src/concurrency
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/kernel/fwd.hfa

    ra494d105 r13fdf86  
    347347                                        struct oneshot * want = expected == 0p ? 1p : 2p;
    348348                                        if(__atomic_compare_exchange_n(&this.ptr, &expected, want, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)) {
    349                                                 if( expected == 0p ) { /* paranoid */ verify( this.ptr == 1p); return 0p; }
     349                                                if( expected == 0p ) { return 0p; }
    350350                                                thread$ * ret = post( *expected, do_unpark );
    351351                                                __atomic_store_n( &this.ptr, 1p, __ATOMIC_SEQ_CST);
  • libcfa/src/concurrency/kernel_private.hfa

    ra494d105 r13fdf86  
    6060extern bool __preemption_enabled();
    6161
     62enum {
     63        PREEMPT_NORMAL    = 0,
     64        PREEMPT_TERMINATE = 1,
     65        PREEMPT_IO = 2,
     66};
     67
    6268static inline void __disable_interrupts_checked() {
    6369        /* paranoid */ verify( __preemption_enabled() );
Note: See TracChangeset for help on using the changeset viewer.