/* Signals the event. Queues the event to be notified if needed. */
EFI_STATUS EFIAPI CoreSignalEvent(IN EFI_EVENT UserEvent)
/* Signals the event. Queues the event to be notified if needed. */
EFI_STATUS EFIAPI CoreSignalEvent(IN EFI_EVENT UserEvent)
{
  IEVENT  *Event;
  Event = UserEvent;
  if (Event == NULL) {
    return EFI_INVALID_PARAMETER;
  }
  if (Event->Signature != EVENT_SIGNATURE) {
    return EFI_INVALID_PARAMETER;
  }
  CoreAcquireEventLock ();
  if (Event->SignalCount == 0x00000000) {
    Event->SignalCount++;
    if ((Event->Type & EVT_NOTIFY_SIGNAL) != 0) {
      if ((Event->ExFlag & EVT_EXFLAG_EVENT_GROUP) != 0) {
        CoreReleaseEventLock ();
        CoreNotifySignalList (&Event->EventGroup);
        CoreAcquireEventLock ();
      } else {
        CoreNotifyEvent (Event);
      }
    }
  }
  CoreReleaseEventLock ();
  return EFI_SUCCESS;
}