ocarina/tests/threads.py
Bryan Schumaker 15cc5d22f0 Backend and frontend changes
Libsaria events now support starting specific callback functions in a
background thread.  This replaces starting a specific event in the
background.

I have a library tab that is added to the main window through use of the
ocarina.add_tab function.

I have new tests for walking the tree and running multiple threads with
locks.
2010-08-19 23:02:30 -04:00

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()