diff -r d884e5045327 autoupdate.services/src/org/netbeans/modules/autoupdate/services/OperationSupportImpl.java --- a/autoupdate.services/src/org/netbeans/modules/autoupdate/services/OperationSupportImpl.java Wed Oct 01 14:28:32 2008 +0200 +++ b/autoupdate.services/src/org/netbeans/modules/autoupdate/services/OperationSupportImpl.java Tue Oct 07 16:00:21 2008 +0200 @@ -60,6 +60,8 @@ import org.netbeans.spi.autoupdate.CustomInstaller; import org.openide.LifecycleManager; import org.openide.modules.ModuleInfo; +import org.openide.util.Mutex.ExceptionAction; +import org.openide.util.MutexException; /** * @author Jiri Rechtacek, Radek Matous @@ -125,7 +127,7 @@ UpdateElementImpl impl = Trampoline.API.impl (operationInfo.getUpdateElement ()); moduleInfos.addAll (impl.getModuleInfos ()); } - Set modules = new HashSet(); + final Set modules = new HashSet(); for (ModuleInfo info : moduleInfos) { Module m = Utilities.toModule (info); if (Utilities.canEnable (m)) { @@ -137,7 +139,20 @@ } } assert mm != null; - enable(mm, modules); + final ModuleManager fmm = mm; + try { + fmm.mutex ().writeAccess (new ExceptionAction () { + public Object run () throws Exception { + return enable(fmm, modules); + } + }); + } catch (MutexException ex) { + Exception x = ex.getException (); + assert x instanceof OperationException : x + " is instanceof OperationException"; + if (x instanceof OperationException) { + throw (OperationException) x; + } + } } finally { if (progress != null) { progress.finish();