ocarina/tests/threads.py

27 lines
422 B
Python

# Bryan Schumaker (8/19/2010)
from libsaria import threads
def test(a, b, c):
lock = threads.get_mutex("print")
lock.acquire()
print "a:", a
print "b:", b
print "c:", c
lock.release()
def test2():
lock = threads.get_mutex("print")
lock.acquire()
print "No args!"
lock.release()
a = threads.background(test, 1, 2, 3)
b = threads.background(test2)
if a and a.is_alive():
a.join()
if b.is_alive():
b.join()