Had to change how i stored thread_id
Instead of using the thread_id as a index number, I am using as whatever the user specifies.
added a struct of type mutex with lock, unlock and count