Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hpc-workflow-manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FIJI
hpc-workflow-manager
Commits
5b147b7e
Commit
5b147b7e
authored
6 years ago
by
Petr Bainar
Browse files
Options
Downloads
Patches
Plain Diff
miscStuff: use a latch for thread synchronization during table filling
parent
c153eafc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!31
Misc stuff extended
,
!30
Create SimpleObservableList and use it for SPIMPipelineProgressViewController
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/SPIMPipelineProgressViewController.java
+23
-17
23 additions, 17 deletions
...spim_benchmark/ui/SPIMPipelineProgressViewController.java
with
23 additions
and
17 deletions
haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/SPIMPipelineProgressViewController.java
+
23
−
17
View file @
5b147b7e
...
...
@@ -6,9 +6,11 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.concurrent.CountDownLatch
;
import
java.util.concurrent.Executor
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.TimeUnit
;
import
javax.swing.WindowConstants
;
...
...
@@ -79,7 +81,7 @@ public class SPIMPipelineProgressViewController extends BorderPane implements Cl
private
final
Executor
executorFx
=
new
FXFrameExecutorService
();
private
Window
root
;
private
boolean
filled
=
false
;
private
CountDownLatch
fillingLatch
=
new
CountDownLatch
(
1
)
;
private
boolean
closed
;
...
...
@@ -89,22 +91,7 @@ public class SPIMPipelineProgressViewController extends BorderPane implements Cl
@Override
public
void
onChanged
(
Change
<?
extends
Task
>
c
)
{
if
(!
filled
)
{
Progress
progress
=
ModalDialogs
.
doModal
(
new
ProgressDialog
(
root
,
"Downloading tasks"
),
WindowConstants
.
DO_NOTHING_ON_CLOSE
);
executorServiceWS
.
execute
(()
->
{
try
{
fillTable
();
}
finally
{
filled
=
true
;
progress
.
done
();
}
});
}
fillingLatch
.
countDown
();
}
};
...
...
@@ -128,6 +115,18 @@ public class SPIMPipelineProgressViewController extends BorderPane implements Cl
public
void
setJob
(
final
ObservableBenchmarkJob
job
)
{
observedValue
=
job
.
getObservableTaskList
();
observedValue
.
subscribe
(
taskChangeListener
);
Progress
progress
=
ModalDialogs
.
doModal
(
new
ProgressDialog
(
root
,
"Downloading tasks"
),
WindowConstants
.
DO_NOTHING_ON_CLOSE
);
executorServiceWS
.
execute
(()
->
{
try
{
fillTable
();
}
finally
{
progress
.
done
();
}
});
}
private
void
init
()
{
...
...
@@ -155,6 +154,13 @@ public class SPIMPipelineProgressViewController extends BorderPane implements Cl
return
;
}
try
{
fillingLatch
.
await
(
10
,
TimeUnit
.
SECONDS
);
}
catch
(
InterruptedException
exc
)
{
// Handle time out properly
}
final
Optional
<
Integer
>
optional
=
getNumberOfTimepoints
(
observedValue
);
if
(!
optional
.
isPresent
())
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment