fewer use of GUI_Thread.now to reduce danger of deadlock on shutdown;
authorwenzelm
Tue Jan 05 15:40:25 2016 +0100 (2016-01-05)
changeset 62062ee610059b0e9
parent 62061 bd2ccef8209b
child 62063 b921b251f91f
fewer use of GUI_Thread.now to reduce danger of deadlock on shutdown;
src/Tools/jEdit/src/jedit_editor.scala
src/Tools/jEdit/src/plugin.scala
     1.1 --- a/src/Tools/jEdit/src/jedit_editor.scala	Tue Jan 05 15:35:08 2016 +0100
     1.2 +++ b/src/Tools/jEdit/src/jedit_editor.scala	Tue Jan 05 15:40:25 2016 +0100
     1.3 @@ -196,8 +196,10 @@
     1.4          try { Doc.view(path) }
     1.5          catch {
     1.6            case exn: Throwable =>
     1.7 -            GUI.error_dialog(view,
     1.8 -              "Documentation error", GUI.scrollable_text(Exn.message(exn)))
     1.9 +            GUI_Thread.later {
    1.10 +              GUI.error_dialog(view,
    1.11 +                "Documentation error", GUI.scrollable_text(Exn.message(exn)))
    1.12 +            }
    1.13          }
    1.14        }
    1.15      }
    1.16 @@ -224,7 +226,9 @@
    1.17            try { Isabelle_System.open(name) }
    1.18            catch {
    1.19              case exn: Throwable =>
    1.20 -              GUI.error_dialog(view, "System error", GUI.scrollable_text(Exn.message(exn)))
    1.21 +              GUI_Thread.later {
    1.22 +                GUI.error_dialog(view, "System error", GUI.scrollable_text(Exn.message(exn)))
    1.23 +              }
    1.24            }
    1.25          }
    1.26        override def toString: String = "URL " + quote(name)
     2.1 --- a/src/Tools/jEdit/src/plugin.scala	Tue Jan 05 15:35:08 2016 +0100
     2.2 +++ b/src/Tools/jEdit/src/plugin.scala	Tue Jan 05 15:40:25 2016 +0100
     2.3 @@ -146,7 +146,7 @@
     2.4  
     2.5    /* current document content */
     2.6  
     2.7 -  def snapshot(view: View): Document.Snapshot =
     2.8 +  def snapshot(view: View): Document.Snapshot = GUI_Thread.now
     2.9    {
    2.10      val buffer = view.getBuffer
    2.11      document_model(buffer) match {
    2.12 @@ -293,8 +293,10 @@
    2.13          delay_load.invoke()
    2.14  
    2.15        case Session.Shutdown =>
    2.16 -        PIDE.exit_models(JEdit_Lib.jedit_buffers().toList)
    2.17 -        delay_load.revoke()
    2.18 +        GUI_Thread.later {
    2.19 +          delay_load.revoke()
    2.20 +          PIDE.exit_models(JEdit_Lib.jedit_buffers().toList)
    2.21 +        }
    2.22  
    2.23        case _ =>
    2.24      }