can you please give me more info about the error code 176?
I found it is CKR_SESSION_CLOSED:
The session was closed during the execution of the function.
But can you give me more details? This code runs from a lot of time and this never happened. Yesterday it blocked our access to the hsm..
I guess the problem is similar to the other one you posted in the forum.
If you are strongly using multithreading you should synchronize the calls to OpenSession and CloseSession