16
16
#include " unicode/ucnv.h"
17
17
#include " unicode/unistr.h"
18
18
#include " cstr.h"
19
+ #include " mutex.h"
20
+ #include " umutex.h"
19
21
20
22
/*
21
23
To add a new enum type
@@ -608,6 +610,8 @@ U_CAPI void udbg_writeIcuInfo(FILE *out) {
608
610
#include < ostream>
609
611
#include < iostream>
610
612
613
+ static icu::UMutex gKnownIssuesLock ;
614
+
611
615
class KnownIssues {
612
616
public:
613
617
KnownIssues ();
@@ -650,6 +654,7 @@ static std::string mapTicketId(const char *ticketStr) {
650
654
void KnownIssues::add (const char *ticketStr, const char *where, const char16_t *msg, UBool *firstForTicket, UBool *firstForWhere)
651
655
{
652
656
const std::string ticket = mapTicketId (ticketStr);
657
+ icu::Mutex mutex (&gKnownIssuesLock );
653
658
if (fTable .find (ticket) == fTable .end ()) {
654
659
if (firstForTicket!=nullptr ) *firstForTicket = true ;
655
660
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 *
674
679
void KnownIssues::add (const char *ticketStr, const char *where, const char *msg, UBool *firstForTicket, UBool *firstForWhere)
675
680
{
676
681
const std::string ticket = mapTicketId (ticketStr);
682
+ icu::Mutex mutex (&gKnownIssuesLock );
677
683
if (fTable .find (ticket) == fTable .end ()) {
678
684
if (firstForTicket!=nullptr ) *firstForTicket = true ;
679
685
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,
696
702
697
703
UBool KnownIssues::print ()
698
704
{
705
+ icu::Mutex mutex (&gKnownIssuesLock );
699
706
if (fTable .empty ()) {
700
707
return false ;
701
708
}
0 commit comments