Skip to content
Snippets Groups Projects
  • rsc's avatar
    · ab08960f
    rsc authored
    Final word on the locking fiasco?
    
    Change pushcli / popcli so that they can never turn on
    interrupts unexpectedly.  That is, if interrupts are on,
    then pushcli(); popcli(); turns them off and back on, but
    if they are off to begin with, then pushcli(); popcli(); is
    a no-op.
    
    I think our fundamental mistake was having a primitive
    (release and then popcli nee spllo) that could turn
    interrupts on at unexpected moments instead of being
    explicit about when we want to start allowing interrupts.
    
    With the new semantics, all the manual fiddling of ncli
    to force interrupts off in certain sections goes away.
    In return, we must explicitly mark the places where
    we want to enable interrupts unconditionally, by calling sti().
    There is only one: inside the scheduler loop.
    ab08960f