File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
src/main/java/com/antkorwin/xsync Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ You need to add next dependencies:
21
21
<dependency >
22
22
<groupId >com.github.antkorwin</groupId >
23
23
<artifactId >xsync</artifactId >
24
- <version >0.4 </version >
24
+ <version >0.5 </version >
25
25
</dependency >
26
26
```
27
27
Original file line number Diff line number Diff line change @@ -25,7 +25,16 @@ public void execute(KeyT mutexKey, Runnable runnable) {
25
25
}
26
26
}
27
27
28
-
28
+ /**
29
+ * Evaluate a supplier in a synchronization block on a mutex,
30
+ * which created from the mutexKey value.
31
+ *
32
+ * @param mutexKey key for the synchronization locks
33
+ * @param supplier function that we need to run in sync. block
34
+ * @param <ResultT> type of tht result of a supplier
35
+ *
36
+ * @return result which return by a supplier
37
+ */
29
38
public <ResultT > ResultT evaluate (KeyT mutexKey , Supplier <ResultT > supplier ) {
30
39
XMutex <KeyT > mutex = mutexFactory .getMutex (mutexKey );
31
40
synchronized (mutex ) {
You can’t perform that action at this time.
0 commit comments