pygeek · GitHub

Bug report

Bug description:

threading.Barrier at no point checks for valid parties. parties, of a negative value, or invalid type hang indefinitely on .wait(). This behavior is inconsistent from the behavior of any other threading primitives, which either conduct sanity checks on args during initialization, or fail at some point in their execution.

Steps to reproduce:

"from threading import Barrier # negative barrier = Barrier(-1) # barrier.wait() # invalid type string barrier = Barrier("test") # barrier.wait() # invalid type float barrier = Barrier(0.5) # barrier.wait() # invalid type object barrier = Barrier(object()) #

Read the original on github.com ↗