Skip to content

Commit fe7ef9e

Browse files
committed
use try block in disable_polyester_threads
1 parent 8d55889 commit fe7ef9e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/utility.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ problem (in such cases it is best to multithread only at the outermost level).
88
"""
99
function disable_polyester_threads(f::F) where {F}
1010
t, r = request_threads(num_threads())
11-
f()
12-
foreach(free_threads!, r)
11+
try
12+
f()
13+
finally
14+
foreach(free_threads!, r)
15+
end
1316
end

0 commit comments

Comments
 (0)