Addressing code review feedbacks
authorAndrew Au <andrewau@microsoft.com>
Thu, 2 May 2019 01:31:14 +0000 (18:31 -0700)
committerAndrew Au <cshung@gmail.com>
Thu, 2 May 2019 01:33:08 +0000 (18:33 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/78360d92a412b3ba8f0577121fcbb488a11e797f

src/coreclr/src/vm/eventpipebuffer.h
src/coreclr/src/vm/eventpipebuffermanager.cpp
src/coreclr/src/vm/eventpipebuffermanager.h

index ffa0ad6..fc0fa62 100644 (file)
@@ -146,10 +146,11 @@ public:
     // Input of NULL gets the first event.
     EventPipeEventInstance* GetNext(EventPipeEventInstance *pEvent, LARGE_INTEGER beforeTimeStamp);
 
-    // Get the next event from the buffer, but don't mark it read.
+    // Get the next event from the buffer
     EventPipeEventInstance* PeekNext(LARGE_INTEGER beforeTimeStamp);
 
-    // TODO
+    // Advance the buffer to the next event
+    // pEvent is expected to be the last event returned from PeekNext()
     void PopNext(EventPipeEventInstance *pEvent);
 
     // Check the state of the buffer
index a3387bd..7957bc7 100644 (file)
@@ -647,7 +647,7 @@ void EventPipeBufferManager::SuspendWriteEvent()
 
     _ASSERTE(EnsureConsistency());
 
-    // All calls to this method must not be synchronized by our caller
+    // All calls to this method must be synchronized by our caller
     _ASSERTE(EventPipe::IsLockOwnedByCurrentThread());
 
     CQuickArrayList<EventPipeThread*> threadList;
index 9011c57..06fd80e 100644 (file)
@@ -129,7 +129,7 @@ public:
 
     // From the time this function returns until ResumeWriteEvent() is called a suspended state will 
     // be in effect that blocks all WriteEvent activity. All existing buffers will be in the 
-    // PENDING_FLUSH state and no new EventPipeBuffers or EventPipeBufferLists can be created. Calls to 
+    // READ_ONLY state and no new EventPipeBuffers or EventPipeBufferLists can be created. Calls to 
     // WriteEvent that start during the suspension period or were in progress but hadn't yet recorded 
     // their event into a buffer before the start of the suspension period will return false and the 
     // event will not be recorded. Any events that not recorded as a result of this suspension will be 
@@ -197,7 +197,8 @@ public:
     // Get the count of buffers in the list.
     unsigned int GetCount() const;
 
-    // TODO
+    // Pop the event from the buffer, and potentially clean-up the previous buffer
+    // pNext is expected to be the last event returned from TryGetBuffer()->PeekNext()
     void PopNextEvent(EventPipeBuffer *pContainingBuffer, EventPipeEventInstance *pNext);
 
     // Get the thread associated with this list.