Allocating locks from the thread and not threading module.