n
What happens during a call & nbsp;
Class = "Hljs Language-Python" Data-Highlighted = "Yes"> # Threading Example n Import Time, Threadnn Def MyFunction ( string, Sleeptime, Lock, *Args ): N While span> 1 : n lock.acquire () n time.sleep (Sleeptime) n lock.release () n time.sleep (Sleeptime) n if __name__ == "__ main __" : n lock = thread.allocate_lock () n Thread.start_new_thread (MyFunction, ( "Thread #: 1" , 2 , Lock)) Thread.start_new_thread (MyFunction, ( "Thread #: 2" , 2 , LOCK)) n n div>
danmodenov@mail.ru
·