summaryrefslogtreecommitdiff
path: root/python/testData/debug/test_multithread.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/testData/debug/test_multithread.py')
-rw-r--r--python/testData/debug/test_multithread.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/python/testData/debug/test_multithread.py b/python/testData/debug/test_multithread.py
new file mode 100644
index 000000000000..03c0811ded8b
--- /dev/null
+++ b/python/testData/debug/test_multithread.py
@@ -0,0 +1,24 @@
+try:
+ import thread
+except :
+ import _thread as thread
+
+import threading
+
+def bar(y):
+ z = 100 + y
+ print("Z=%d"%z)
+
+def foo(x):
+ y = x + 1
+ print("Y=%d"%y)
+
+ t = threading.Thread(target=bar, args=(y,))
+ t.start()
+
+
+id = thread.start_new_thread(foo, (1,))
+
+while True:
+ pass
+