bneradt commented on code in PR #10917:
URL: https://github.com/apache/trafficserver/pull/10917#discussion_r1424353371
##########
plugins/experimental/header_freq/header_freq.cc:
##########
@@ -138,7 +164,16 @@ count_all_headers(TSMBuffer &bufp, TSMLoc &hdr_loc,
std::map<std::string, unsign
c = tolower(c);
}
- ++map[str];
+ if (map.find(str) == map.end()) {
+ std::unique_lock<std::shared_mutex> lock{map_mutex};
Review Comment:
Yeah, good point. I should grab the read lock before then and upgrade if the
entry needs to be added.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]