public void StartEventSafe(Event e)
 {
     lock (m_EventsUnSafe)
     {
         m_CurrentEvent = e;
         m_EventsUnSafe.Add(e);
     }
 }
 public void FinishTopLevelCallSafe(Call topLevelCall)
 {
     lock (m_EventsUnSafe)
     {
         // Careful here, calling "Safe" function which means another lock is being acquired inside the current lock.
         m_EventForCurrentTopLevelCall.AddTopLevelCallSafe(topLevelCall);
         m_EventForCurrentTopLevelCall = null;
     }
 }
        public void BeginTopLevelCallSafe()
        {
            lock (m_EventsUnSafe)
            {
                if (m_CurrentEvent == null)
                {
                    // No need to watch out, acquires same lock we already have, no problem.
                    StartEventSafe(new Event("<unknown>", "<unknown>"));
                }

                m_EventForCurrentTopLevelCall = m_CurrentEvent;
            }
        }
 public void AddReadyStateChangeEvent(Event e)
 {
     XhrEvents.Add(new XhrEvent() { Type = XhrEventType.ReadyStateChange, Event = e });
 }