src/Pure/System/progress.scala
changeset 78586 e92bbd5fd66f
parent 78565 05de3e068312
child 78611 7b80cc4701c2
equal deleted inserted replaced
78585:cf114894a5ed 78586:e92bbd5fd66f
   368     if (_context == 0) throw new IllegalStateException("Database_Progress after exit")
   368     if (_context == 0) throw new IllegalStateException("Database_Progress after exit")
   369 
   369 
   370     body
   370     body
   371   }
   371   }
   372 
   372 
   373   private def sync_database[A](body: => A): A = {
   373   private def sync_database[A](body: => A): A = synchronized {
   374     Progress.private_data.transaction_lock(db, label = "Database_Progress.sync_database") {
   374     Progress.private_data.transaction_lock(db, label = "Database_Progress.sync_database") {
   375       _stopped_db = Progress.private_data.read_progress_stopped(db, _context)
   375       _stopped_db = Progress.private_data.read_progress_stopped(db, _context)
   376 
   376 
   377       if (_stopped_db && !base_progress.stopped) base_progress.stop()
   377       if (_stopped_db && !base_progress.stopped) base_progress.stop()
   378       if (!_stopped_db && base_progress.stopped && output_stopped) {
   378       if (!_stopped_db && base_progress.stopped && output_stopped) {