Skip to content

Commit

Permalink
More sid-locking.
Browse files Browse the repository at this point in the history
  • Loading branch information
mihxil committed Dec 6, 2024
1 parent 502ad73 commit 60b5f3f
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import nl.vpro.util.locker.ObjectLocker;
import nl.vpro.util.locker.ObjectLocker.LockHolder;

import static nl.vpro.util.locker.ObjectLocker.withKeyLock;
import static nl.vpro.util.locker.ObjectLocker.withObjectLock;

/**
Expand Down Expand Up @@ -248,4 +249,18 @@ public static <T> T withMidLock(
reason, callable);
}


/**
* Locks the given {@link MediaIdentifiable} on its {@link MediaIdentifiable#getCorrelation()}
*
*/
public static <T> T withSidLock(
@NonNull ScheduleEventIdentifier sid,
@NonNull String reason,
@NonNull Callable<T> callable) {
return withKeyLock(
sid,
reason, callable);
}

}

0 comments on commit 60b5f3f

Please sign in to comment.