Skip to content

Commit

Permalink
attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
DriesSchaumont committed Nov 14, 2024
1 parent b6fcca7 commit e1584c2
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class IDChecker {
final def items = [] as Set
final def items = Collections.synchronizedSet(new HashSet())

@groovy.transform.WithWriteLock
@groovy.transform.Synchronized
boolean observe(String item) {
if (items.contains(item)) {
return false
Expand All @@ -11,12 +11,12 @@ class IDChecker {
}
}

@groovy.transform.WithReadLock
@groovy.transform.Synchronized
boolean contains(String item) {
return items.contains(item)
}

@groovy.transform.WithReadLock
@groovy.transform.Synchronized
Set getItems() {
return items.clone()
}
Expand Down

0 comments on commit e1584c2

Please sign in to comment.