7
context = gnomevfs.Context()
9
def do_something(context):
10
print 'Running counter in thread %s' % thread.get_ident()
16
if context.check_cancellation():
17
print 'Cancelled counter'
20
def cancel_in_thread(context):
21
print 'Calling cancel in thread %s' % thread.get_ident()
24
if __name__ == '__main__':
25
thread.start_new_thread(do_something, (context,))
26
thread.start_new_thread(cancel_in_thread, (context,))