n0va_sa

Python_thread_program_5

Sep 20th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. #python3
  2. import threading,time
  3.  
  4.  
  5. def uf():
  6.     print("Inside Fun uf")
  7.     print("Current Thread = " + str(threading.currentThread()))
  8.     time.sleep(5)
  9.     print(str(threading.enumerate()))
  10.     print ("Exitting from thread")
  11.  
  12. def main():
  13.     print("Current Thread = " + str(threading.currentThread()))
  14.     t = threading.Thread(target=uf,name="UF-1")
  15.     t.start()
  16.     t.join()
  17.     print("Main Function Exited")
  18.  
  19.  
  20. main()
Add Comment
Please, Sign In to add comment