src/Pure/Concurrent/isabelle_thread.scala
changeset 75380 2cb2606ce075
parent 73367 77ef8bef0593
child 75393 87ebf5a50283
equal deleted inserted replaced
75379:4f6a6ba7387d 75380:2cb2606ce075
   146   /* interrupt state */
   146   /* interrupt state */
   147 
   147 
   148   // synchronized, with concurrent changes
   148   // synchronized, with concurrent changes
   149   private var interrupt_postponed: Boolean = false
   149   private var interrupt_postponed: Boolean = false
   150 
   150 
   151   def clear_interrupt: Boolean = synchronized
   151   def clear_interrupt: Boolean = synchronized {
   152   {
       
   153     val was_interrupted = isInterrupted || interrupt_postponed
   152     val was_interrupted = isInterrupted || interrupt_postponed
   154     Exn.Interrupt.dispose()
   153     Exn.Interrupt.dispose()
   155     interrupt_postponed = false
   154     interrupt_postponed = false
   156     was_interrupted
   155     was_interrupted
   157   }
   156   }
   158 
   157 
   159   def raise_interrupt: Unit = synchronized
   158   def raise_interrupt: Unit = synchronized {
   160   {
       
   161     interrupt_postponed = false
   159     interrupt_postponed = false
   162     super.interrupt()
   160     super.interrupt()
   163   }
   161   }
   164 
   162 
   165   def postpone_interrupt: Unit = synchronized
   163   def postpone_interrupt: Unit = synchronized {
   166   {
       
   167     interrupt_postponed = true
   164     interrupt_postponed = true
   168     Exn.Interrupt.dispose()
   165     Exn.Interrupt.dispose()
   169   }
   166   }
   170 
   167 
   171 
   168