author | wenzelm |
Wed, 10 Jun 2020 19:59:12 +0200 | |
changeset 71932 | 65fd0f032a75 |
parent 69838 | 4419d4d675c3 |
child 72247 | c06260b7152c |
permissions | -rw-r--r-- |
71932
65fd0f032a75
updated to jedit-5.6pre1 (repository version 25349);
wenzelm
parents:
69838
diff
changeset
|
1 |
diff -ru 5.6pre1/jEdit-orig/org/gjt/sp/jedit/io/VFSManager.java 5.6pre1/jEdit-patched/org/gjt/sp/jedit/io/VFSManager.java |
65fd0f032a75
updated to jedit-5.6pre1 (repository version 25349);
wenzelm
parents:
69838
diff
changeset
|
2 |
--- 5.6pre1/jEdit-orig/org/gjt/sp/jedit/io/VFSManager.java 2020-05-20 11:10:11.000000000 +0200 |
65fd0f032a75
updated to jedit-5.6pre1 (repository version 25349);
wenzelm
parents:
69838
diff
changeset
|
3 |
+++ 5.6pre1/jEdit-patched/org/gjt/sp/jedit/io/VFSManager.java 2020-06-10 15:37:21.842393040 +0200 |
65fd0f032a75
updated to jedit-5.6pre1 (repository version 25349);
wenzelm
parents:
69838
diff
changeset
|
4 |
@@ -380,6 +380,18 @@ |
69696
9fd395ff57bc
avoid crash of jEdit.closeBuffer() via TaskManager.instance.waitForIoTasks() due to race condition of save() vs. automatic load() of already open buffer, e.g. relevant for save-as on "isabelle-export:" artifacts;
wenzelm
parents:
diff
changeset
|
5 |
|
9fd395ff57bc
avoid crash of jEdit.closeBuffer() via TaskManager.instance.waitForIoTasks() due to race condition of save() vs. automatic load() of already open buffer, e.g. relevant for save-as on "isabelle-export:" artifacts;
wenzelm
parents:
diff
changeset
|
6 |
if(vfsUpdates.size() == 1) |
9fd395ff57bc
avoid crash of jEdit.closeBuffer() via TaskManager.instance.waitForIoTasks() due to race condition of save() vs. automatic load() of already open buffer, e.g. relevant for save-as on "isabelle-export:" artifacts;
wenzelm
parents:
diff
changeset
|
7 |
{ |
9fd395ff57bc
avoid crash of jEdit.closeBuffer() via TaskManager.instance.waitForIoTasks() due to race condition of save() vs. automatic load() of already open buffer, e.g. relevant for save-as on "isabelle-export:" artifacts;
wenzelm
parents:
diff
changeset
|
8 |
+ // slowdown race concerning Buffer.isLoading() status |
9fd395ff57bc
avoid crash of jEdit.closeBuffer() via TaskManager.instance.waitForIoTasks() due to race condition of save() vs. automatic load() of already open buffer, e.g. relevant for save-as on "isabelle-export:" artifacts;
wenzelm
parents:
diff
changeset
|
9 |
+ // of Buffer.save() + Buffer.finishSaving() |
9fd395ff57bc
avoid crash of jEdit.closeBuffer() via TaskManager.instance.waitForIoTasks() due to race condition of save() vs. automatic load() of already open buffer, e.g. relevant for save-as on "isabelle-export:" artifacts;
wenzelm
parents:
diff
changeset
|
10 |
+ // versus Buffer.load() + "runnable" |
9fd395ff57bc
avoid crash of jEdit.closeBuffer() via TaskManager.instance.waitForIoTasks() due to race condition of save() vs. automatic load() of already open buffer, e.g. relevant for save-as on "isabelle-export:" artifacts;
wenzelm
parents:
diff
changeset
|
11 |
+ try |
9fd395ff57bc
avoid crash of jEdit.closeBuffer() via TaskManager.instance.waitForIoTasks() due to race condition of save() vs. automatic load() of already open buffer, e.g. relevant for save-as on "isabelle-export:" artifacts;
wenzelm
parents:
diff
changeset
|
12 |
+ { |
9fd395ff57bc
avoid crash of jEdit.closeBuffer() via TaskManager.instance.waitForIoTasks() due to race condition of save() vs. automatic load() of already open buffer, e.g. relevant for save-as on "isabelle-export:" artifacts;
wenzelm
parents:
diff
changeset
|
13 |
+ Thread.sleep(100); |
9fd395ff57bc
avoid crash of jEdit.closeBuffer() via TaskManager.instance.waitForIoTasks() due to race condition of save() vs. automatic load() of already open buffer, e.g. relevant for save-as on "isabelle-export:" artifacts;
wenzelm
parents:
diff
changeset
|
14 |
+ } |
9fd395ff57bc
avoid crash of jEdit.closeBuffer() via TaskManager.instance.waitForIoTasks() due to race condition of save() vs. automatic load() of already open buffer, e.g. relevant for save-as on "isabelle-export:" artifacts;
wenzelm
parents:
diff
changeset
|
15 |
+ catch(InterruptedException ie) |
9fd395ff57bc
avoid crash of jEdit.closeBuffer() via TaskManager.instance.waitForIoTasks() due to race condition of save() vs. automatic load() of already open buffer, e.g. relevant for save-as on "isabelle-export:" artifacts;
wenzelm
parents:
diff
changeset
|
16 |
+ { |
9fd395ff57bc
avoid crash of jEdit.closeBuffer() via TaskManager.instance.waitForIoTasks() due to race condition of save() vs. automatic load() of already open buffer, e.g. relevant for save-as on "isabelle-export:" artifacts;
wenzelm
parents:
diff
changeset
|
17 |
+ Thread.currentThread().interrupt(); |
9fd395ff57bc
avoid crash of jEdit.closeBuffer() via TaskManager.instance.waitForIoTasks() due to race condition of save() vs. automatic load() of already open buffer, e.g. relevant for save-as on "isabelle-export:" artifacts;
wenzelm
parents:
diff
changeset
|
18 |
+ } |
9fd395ff57bc
avoid crash of jEdit.closeBuffer() via TaskManager.instance.waitForIoTasks() due to race condition of save() vs. automatic load() of already open buffer, e.g. relevant for save-as on "isabelle-export:" artifacts;
wenzelm
parents:
diff
changeset
|
19 |
+ |
9fd395ff57bc
avoid crash of jEdit.closeBuffer() via TaskManager.instance.waitForIoTasks() due to race condition of save() vs. automatic load() of already open buffer, e.g. relevant for save-as on "isabelle-export:" artifacts;
wenzelm
parents:
diff
changeset
|
20 |
// we were the first to add an update; |
9fd395ff57bc
avoid crash of jEdit.closeBuffer() via TaskManager.instance.waitForIoTasks() due to race condition of save() vs. automatic load() of already open buffer, e.g. relevant for save-as on "isabelle-export:" artifacts;
wenzelm
parents:
diff
changeset
|
21 |
// add update sending runnable to AWT |
9fd395ff57bc
avoid crash of jEdit.closeBuffer() via TaskManager.instance.waitForIoTasks() due to race condition of save() vs. automatic load() of already open buffer, e.g. relevant for save-as on "isabelle-export:" artifacts;
wenzelm
parents:
diff
changeset
|
22 |
// thread |