blob: 03c0811ded8b344d520bd203d8ef12529a6e7ca7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
|