Adding a locking thread option