This is an automated email from the ASF dual-hosted git repository.
duke8253 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new db5f923 fix race condition
db5f923 is described below
commit db5f9232d0b8f31b999029b44aa9b2b26d4a99bc
Author: Fei Deng <[email protected]>
AuthorDate: Wed Jul 31 15:20:03 2019 -0500
fix race condition
---
iocore/eventsystem/UnixEventProcessor.cc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/iocore/eventsystem/UnixEventProcessor.cc
b/iocore/eventsystem/UnixEventProcessor.cc
index f2bcf4e..3c0e6b0 100644
--- a/iocore/eventsystem/UnixEventProcessor.cc
+++ b/iocore/eventsystem/UnixEventProcessor.cc
@@ -395,8 +395,7 @@ EventProcessor::initThreadState(EThread *t)
// Run all thread type initialization continuations that match the event
types for this thread.
for (int i = 0; i < MAX_EVENT_TYPES; ++i) {
if (t->is_event_type(i)) { // that event type done here, roll thread start
events of that type.
- ++thread_group[i]._started;
- if (thread_group[i]._started == thread_group[i]._count &&
thread_group[i]._afterStartCallback != nullptr) {
+ if (++thread_group[i]._started == thread_group[i]._count &&
thread_group[i]._afterStartCallback != nullptr) {
thread_group[i]._afterStartCallback();
}
// To avoid race conditions on the event in the spawn queue, create a
local one to actually send.