Skip to content

Commit c488c54

Browse files
PetrGuanlalitb
andauthored
Fix the data race in DispatchEvent (#983)
* Fix the data race in DispatchEvent Fix the data race in DispatchEvent * Update according to comments Co-authored-by: Lalit Kumar Bhasin <[email protected]>
1 parent 9e7347f commit c488c54

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/callbacks/DebugSource.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@ namespace MAT_NS_BEGIN {
3535
/// <summary>Microsoft Telemetry SDK invokes this method to dispatch event to client callback</summary>
3636
bool DebugEventSource::DispatchEvent(DebugEvent evt)
3737
{
38-
seq++;
39-
evt.seq = seq;
4038
evt.ts = PAL::getUtcSystemTime();
4139
bool dispatched = false;
42-
40+
4341
{
4442
DE_LOCKGUARD(stateLock());
43+
seq++;
44+
evt.seq = seq;
45+
4546
if (listeners.size()) {
4647
// Events filter handlers list
4748
auto &v = listeners[evt.type];

0 commit comments

Comments
 (0)