Using NSLock to lock current thread