1616#include " unicode/ucnv.h"
1717#include " unicode/unistr.h"
1818#include " cstr.h"
19+ #include " mutex.h"
20+ #include " umutex.h"
1921
2022/*
2123To add a new enum type
@@ -608,6 +610,8 @@ U_CAPI void udbg_writeIcuInfo(FILE *out) {
608610#include < ostream>
609611#include < iostream>
610612
613+ static icu::UMutex gKnownIssuesLock ;
614+
611615class KnownIssues {
612616public:
613617 KnownIssues ();
@@ -650,6 +654,7 @@ static std::string mapTicketId(const char *ticketStr) {
650654void KnownIssues::add (const char *ticketStr, const char *where, const char16_t *msg, UBool *firstForTicket, UBool *firstForWhere)
651655{
652656 const std::string ticket = mapTicketId (ticketStr);
657+ icu::Mutex mutex (&gKnownIssuesLock );
653658 if (fTable .find (ticket) == fTable .end ()) {
654659 if (firstForTicket!=nullptr ) *firstForTicket = true ;
655660 fTable [ticket] = std::map < std::string, std::set < std::string > >();
@@ -674,6 +679,7 @@ void KnownIssues::add(const char *ticketStr, const char *where, const char16_t *
674679void KnownIssues::add (const char *ticketStr, const char *where, const char *msg, UBool *firstForTicket, UBool *firstForWhere)
675680{
676681 const std::string ticket = mapTicketId (ticketStr);
682+ icu::Mutex mutex (&gKnownIssuesLock );
677683 if (fTable .find (ticket) == fTable .end ()) {
678684 if (firstForTicket!=nullptr ) *firstForTicket = true ;
679685 fTable [ticket] = std::map < std::string, std::set < std::string > >();
@@ -696,6 +702,7 @@ void KnownIssues::add(const char *ticketStr, const char *where, const char *msg,
696702
697703UBool KnownIssues::print ()
698704{
705+ icu::Mutex mutex (&gKnownIssuesLock );
699706 if (fTable .empty ()) {
700707 return false ;
701708 }
0 commit comments