Skip to content

Commit

Permalink
more synchronized reports
Browse files Browse the repository at this point in the history
  • Loading branch information
endixk committed Jun 9, 2023
1 parent 46923de commit 1f8a7d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/module/ProfileModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ static void initProg() {
for(int g = 0; g < GenericConfig.QUERY_GENES.length; g++) progress.add(new Status());
tk = new TimeKeeper();
}
static void updateProg(int g, String ch, Integer proc) {
static synchronized void updateProg(int g, String ch, Integer proc) {
progress.get(g).updateStat(ch, proc);
}

Expand Down
5 changes: 2 additions & 3 deletions src/module/ProfileProModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ public static void run(String[] args) {
for(int g = 0; g < GenericConfig.QUERY_GENES.length; g++) {
CreateProfile creator = new CreateProfile(g);
futures.add(executorService.submit(creator));
Thread.sleep(500);
}

executorService.shutdown();
Expand Down Expand Up @@ -282,11 +281,11 @@ static void initProg() {
for(int g = 0; g < GenericConfig.QUERY_GENES.length; g++) progress.add(new Status());
tk = new TimeKeeper();
}
static void updateProg(int g, String ch, Integer proc) {
static synchronized void updateProg(int g, String ch, Integer proc) {
progress.get(g).updateStat(ch, proc);
}

static void printProg() {
static synchronized void printProg() {
StringBuilder build = new StringBuilder("PROGRESS : [");
int fin = 0;

Expand Down

0 comments on commit 1f8a7d7

Please sign in to comment.