You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hmm... Yeah, it looks problematic. I'm not the author of this code but I assume the intention is to allow multiple threads access through Arc to the Impl struct and finalize when all threads are done.
And your point is that you want to call finalize earlier? The problematic part is, the pkcs11 struct assumes that what it holds is an initialized object before finalization. Would it be possible for your code to get all threads to drop their references? That'd deterministically call finalize when the last reference is dropped.
The only way I can find to "gracefully" stop another thread that is blocking on
C_WaitForSlotEvent
is to callC_Finalize
.Pkcs11::finalize()
is a no-op andPkcs11Impl::finalize()
is only called ondrop()
. I cannot drop the library if it is being used in another thread.Is it ok to let
Pkcs11::finalize()
callPkcs11Impl::finalize()
?We also need to fix
Pkcs11::is_initialized()
but that is a separate issue.The text was updated successfully, but these errors were encountered: