Closed FranklinYu closed 6 years ago
why did you think so?
I didn't "think so"; I was just wondering whether thread safety was in mind when developing this library, because (surprisingly?) not every library author would like to consider such cases. Some would even explicitly state in README like
This library is not meant for threaded Ruby applications
, so race condition is not considered bug there. It is not obvious what is mutated in each method, and I would like to double check before I optimize the production code.
For example, given a
$jwk
which is aJSON::JWK::Set
, would there be race condition when multiple threads doJSON::JWT.decode(token, $jwk)
simultaneously?