code: def _match_and_pop(self, regex_pattern):
          
          results = []
          self.lock.acquire()
          for name in self.event_dict.keys():
              if re.match(regex_pattern, name):
                  q = self.event_dict[name]
                  if q:
                      try:
                          results.append(q.get(False))
                      except:
                          pass
          self.lock.release()
          return results
docs: Pop one event from each of the event queues whose names
          match (in a sense of regular expression) regex_pattern.