diff options
author | Simon Rettberg | 2015-09-28 18:01:35 +0200 |
---|---|---|
committer | Simon Rettberg | 2015-09-28 18:01:35 +0200 |
commit | 4c974ca21d544634097b4d287c0f98bfacdefc55 (patch) | |
tree | d31f33bcc77919e8f6a99661f2b62a873390f457 /daemon | |
parent | Switch to semaphore for signalling the mainloop to check for work (diff) | |
download | taskman-lite-4c974ca21d544634097b4d287c0f98bfacdefc55.tar.gz taskman-lite-4c974ca21d544634097b4d287c0f98bfacdefc55.tar.xz taskman-lite-4c974ca21d544634097b4d287c0f98bfacdefc55.zip |
Handle some uncaught runtime errors, fix race condition
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/src/main/java/org/openslx/taskmanager/main/Taskmanager.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/daemon/src/main/java/org/openslx/taskmanager/main/Taskmanager.java b/daemon/src/main/java/org/openslx/taskmanager/main/Taskmanager.java index 1325dca..69c190a 100644 --- a/daemon/src/main/java/org/openslx/taskmanager/main/Taskmanager.java +++ b/daemon/src/main/java/org/openslx/taskmanager/main/Taskmanager.java @@ -38,9 +38,7 @@ public class Taskmanager implements FinishCallback, Runnable private final Map<String, Class<? extends AbstractTask>> tasks = new ConcurrentHashMap<>(); /** - * All the running/finished task instances. The mainloop will call wait() on this and this object - * is notified as soon as the mainloop should check if there is any task available that can be - * run. + * All the running/finished task instances. */ private final Map<String, AbstractTask> instances = new ConcurrentHashMap<>(); @@ -166,6 +164,7 @@ public class Taskmanager implements FinishCallback, Runnable if ( task.canStart() ) { log.debug( "Started Task " + task.getClass().getSimpleName() + " (" + task.getId() + ")" ); threadPool.execute( task ); + task.markAsStarting(); } } } catch ( RejectedExecutionException e ) { |