Quite easy.Just put a condition variable .Try something like this:
Code:
import appuifw, thread, e32, os
t1,t2=0,0
running_a = 1
running_b = 1
def a():
global t1, running_a
t1=os.getpid()
while running_a == 1:
print "thanks"
def b():
global t2, running_b
t2=os.getpid()
while running_b == 1:
print "abc"
def start():
thread.start_new_thread(a,())
thread.start_new_thread(b,())
def stop():
global running_a, running_b
running_a = 0 //exits the thread a
running_b = 0 //exits the thread b
appuifw.app.menu=[(u"Start", start),
(u"stop", stop)]
app_lock = e32.Ao_lock()
app_lock.wait()
Thats it. Hope it helps u..
Best Regards,
SajiSoft