+idlock = threading.Lock()
+procevid = 0
+class startevent(event):
+ def __init__(self):
+ super(startevent, self).__init__()
+ global procevid
+ idlock.acquire()
+ try:
+ self.id = procevid
+ procevid += 1
+ finally:
+ idlock.release()
+
+class finishevent(event):
+ def __init__(self, start, aborted):
+ super(finishevent, self).__init__()
+ self.id = start.id
+ self.aborted = aborted
+