add sampleThreading, derived from threading.thread, lock is used to make data thread safe.