-----------------------------------
#!/usr/bin/python
import threading,time
class BT(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
def run(self):
time.sleep(1)
b = BT()
b.start()
time.sleep(2)
b.start()
-----------------------------------
[root@sapr01-gtpsam client]# python test.py
Traceback (most recent call last):
File "test.py", line 15, in <module>
b.start()
File "/usr/lib64/python2.6/threading.py", line 465, in start
raise RuntimeError("thread already started")
RuntimeError: thread already started
-----------------------------------
Отсюда вопрос, как перезапустить тред ???