Skip to content

Commit

Permalink
Merge pull request #1390 from msvinaykumar/syncBlocIssue
Browse files Browse the repository at this point in the history
Ensure access to the variable is synchronized
  • Loading branch information
dinogun authored Nov 26, 2024
2 parents da42013 + 34cbbd7 commit 8beb188
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class BulkJobStatus {
private String jobID;
private String status;
private int total_experiments;
private int processed_experiments;
private int processed_experiments; //todo : If the primary operations are increments or simple atomic updates, use AtomicInteger. It is designed for lock-free thread-safe access
@JsonProperty("job_start_time")
private String startTime; // Change to String to store formatted time
@JsonProperty("job_end_time")
Expand Down Expand Up @@ -144,11 +144,11 @@ public void setTotal_experiments(int total_experiments) {
this.total_experiments = total_experiments;
}

public int getProcessed_experiments() {
public synchronized int getProcessed_experiments() {
return processed_experiments;
}

public void setProcessed_experiments(int processed_experiments) {
public synchronized void setProcessed_experiments(int processed_experiments) {
this.processed_experiments = processed_experiments;
}

Expand Down

0 comments on commit 8beb188

Please sign in to comment.