I\'m trying to write a function that can wait multiple events to be set and return which one is set. After reading some posts I came up with the following. Just as my commen