test_threads.py 380 B

12345678910111213
  1. import emacspy_threads, threading, time
  2. emacspy_threads.call_soon_in_main_thread(lambda: print('a'))
  3. emacspy_threads.init()
  4. emacspy_threads.call_soon_in_main_thread(lambda: print('b'))
  5. def test():
  6. time.sleep(1)
  7. emacspy_threads.call_soon_in_main_thread(lambda: print('c'))
  8. emacspy_threads.run_in_main_thread(lambda: print('d'))
  9. threading.Thread(target=test).start()