i was able to fix this using read write lock instead of regular spin lock.
since both of the functions are just reading and not writing it makes a lot of sense having the read lock instead.
like usual i learned something after i post it :)