Skip to content

Commit baae324

Browse files
author
Nathan Marz
committed
protect priority queue with a lock
1 parent 2529452 commit baae324

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/clj/backtype/storm/timer.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
(fn []
2626
(while @active
2727
(try
28-
(let [[time-secs _ _ :as elem] (.peek queue)]
28+
(let [[time-secs _ _ :as elem] (locking lock (.peek queue))]
2929
(if (and elem (>= (current-time-secs) time-secs))
3030
;; imperative to not run the function inside the timer lock
3131
;; otherwise, it's possible to deadlock if function deals with other locks

0 commit comments

Comments
 (0)