This is an automated email from the ASF dual-hosted git repository.
jimjag pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/trunk by this push:
new ae8858429a Wiki Publisher: stop busy-waiting while a dialog is open;
drop the defunct Sun wiki entry
ae8858429a is described below
commit ae8858429a07d9f4eb86a1a1d12b3cd7da720293
Author: Jim Jagielski <[email protected]>
AuthorDate: Thu Oct 22 09:25:48 2026 -0400
Wiki Publisher: stop busy-waiting while a dialog is open; drop the defunct
Sun wiki entry
The sending thread spun a full core until the dialog closed, and hung
forever if the dialog task threw an Error.
---
.../sun/star/wiki/MainThreadDialogExecutor.java | 47 ++++++++++++++++++----
.../org/openoffice/Office/Custom/WikiExtension.xcu | 12 ------
2 files changed, 39 insertions(+), 20 deletions(-)
diff --git
a/main/swext/mediawiki/src/com/sun/star/wiki/MainThreadDialogExecutor.java
b/main/swext/mediawiki/src/com/sun/star/wiki/MainThreadDialogExecutor.java
index 5345348df8..2715ea25f1 100644
--- a/main/swext/mediawiki/src/com/sun/star/wiki/MainThreadDialogExecutor.java
+++ b/main/swext/mediawiki/src/com/sun/star/wiki/MainThreadDialogExecutor.java
@@ -84,11 +84,7 @@ public class MainThreadDialogExecutor implements XCallback
if ( xRequest != null )
{
xRequest.addCallback( aExecutor, Any.VOID );
- do
- {
- Thread.yield();
- }
- while( !aExecutor.m_bCalled );
+ aExecutor.WaitForCall();
}
}
else
@@ -120,7 +116,28 @@ public class MainThreadDialogExecutor implements XCallback
{
m_xDialog = xDialog;
m_bClose = true;
- m_bCalled = true; // no yielding, asynchronous closing
+ m_bCalled = true; // no waiting, asynchronous closing
+ }
+
+ private void WaitForCall()
+ {
+ boolean bInterrupted = false;
+ synchronized( this )
+ {
+ while( !m_bCalled )
+ {
+ try
+ {
+ wait();
+ }
+ catch( InterruptedException e )
+ {
+ bInterrupted = true;
+ }
+ }
+ }
+ if ( bInterrupted )
+ Thread.currentThread().interrupt();
}
private boolean GetResult()
@@ -129,6 +146,22 @@ public class MainThreadDialogExecutor implements XCallback
}
public void notify( Object aData )
+ {
+ try
+ {
+ CallInMainThread();
+ }
+ finally
+ {
+ synchronized( this )
+ {
+ m_bCalled = true;
+ notifyAll();
+ }
+ }
+ }
+
+ private void CallInMainThread()
{
if ( m_aTask != null )
{
@@ -158,7 +191,5 @@ public class MainThreadDialogExecutor implements XCallback
m_bResult = true;
}
}
-
- m_bCalled = true;
}
}
diff --git
a/main/swext/mediawiki/src/registry/data/org/openoffice/Office/Custom/WikiExtension.xcu
b/main/swext/mediawiki/src/registry/data/org/openoffice/Office/Custom/WikiExtension.xcu
index f28cd929ab..19dd8475f1 100644
---
a/main/swext/mediawiki/src/registry/data/org/openoffice/Office/Custom/WikiExtension.xcu
+++
b/main/swext/mediawiki/src/registry/data/org/openoffice/Office/Custom/WikiExtension.xcu
@@ -23,18 +23,6 @@
<oor:component-data xmlns:oor="http://openoffice.org/2001/registry"
xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="WikiExtension"
oor:package="org.openoffice.Office.Custom">
<node oor:name="SpecialData">
- <node oor:name="so-wiki.germany.sun.com" oor:op="fuse">
- <prop oor:name="AllowUnknownCertificate">
- <value>true</value>
- </prop>
- <node oor:name="AdditionalLoginArguments">
- <node oor:name="wpDomain" oor:op="fuse">
- <prop oor:name="Value">
- <value>sun</value>
- </prop>
- </node>
- </node>
- </node>
</node>
<node oor:name="ConnectionList">