Ignore:
Timestamp:
Aug 13, 2020, 1:19:20 PM (2 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
badd22f
Parents:
0240cd69
Message:

Fixed deadlock where threads could acquire the central scheduler lock for writing while preemption was enabled, leading to any attempt at running any thread to deadlock.
Also added runtime checks to catch new code which could forget to disable interrupts

File:
1 edited

Legend:

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

    r0240cd69 r62502cc4  
    516516        ( this.terminated ){ 0 };
    517517        ( this.runner ){};
    518         init( this, name, _cltr );
     518
     519        disable_interrupts();
     520                init( this, name, _cltr );
     521        enable_interrupts( __cfaabi_dbg_ctx );
    519522
    520523        __cfadbg_print_safe(runtime_core, "Kernel : Starting core %p\n", &this);
     
    540543        free( this.stack );
    541544
    542         deinit( this );
     545        disable_interrupts();
     546                deinit( this );
     547        enable_interrupts( __cfaabi_dbg_ctx );
    543548}
    544549
Note: See TracChangeset for help on using the changeset viewer.