Added lock, and supported thread arguments