- if(remotingMonitor.getTotalWork() == 0) {
- throw new InterruptedException("Monitor has zero work units");
+
+ if(remotingMonitor.getTotalWork() == 0 && remotingMonitor.isDone()) {
+ return remotingMonitor;
+
+ }else if (remotingMonitor.getTotalWork() == 0 ){
+ Object result = remotingMonitor.getResult();
+ InterruptedException exception = new InterruptedException("Monitor has zero work units");
+ if (result instanceof UpdateResult){
+ ((UpdateResult)result).addException(exception);
+ }else if (result == null){
+ result = new UpdateResult();
+ }
+