mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
0031944: Foundation Classes - mutex for message level
(cherry picked from commit 0f07a04a85dedd375a5383f3cb0031c0a6d6b329)
This commit is contained in:
@@ -188,6 +188,8 @@ void Message_Report::UpdateActiveInMessenger (const Handle(Message_Messenger)& t
|
||||
//=======================================================================
|
||||
void Message_Report::AddLevel (Message_Level* theLevel, const TCollection_AsciiString& theName)
|
||||
{
|
||||
Standard_Mutex::Sentry aSentry (myMutex);
|
||||
|
||||
myAlertLevels.Append (theLevel);
|
||||
|
||||
Handle(Message_AlertExtended) aLevelRootAlert = new Message_AlertExtended();
|
||||
@@ -221,6 +223,8 @@ void Message_Report::AddLevel (Message_Level* theLevel, const TCollection_AsciiS
|
||||
|
||||
void Message_Report::RemoveLevel (Message_Level* theLevel)
|
||||
{
|
||||
Standard_Mutex::Sentry aSentry (myMutex);
|
||||
|
||||
for (int aLevelIndex = myAlertLevels.Size(); aLevelIndex >= 1; aLevelIndex--)
|
||||
{
|
||||
Message_Level* aLevel = myAlertLevels.Value (aLevelIndex);
|
||||
@@ -245,6 +249,8 @@ void Message_Report::Clear()
|
||||
if (compositeAlerts().IsNull())
|
||||
return;
|
||||
|
||||
Standard_Mutex::Sentry aSentry (myMutex);
|
||||
|
||||
compositeAlerts()->Clear();
|
||||
myAlertLevels.Clear();
|
||||
}
|
||||
@@ -259,6 +265,8 @@ void Message_Report::Clear (Message_Gravity theGravity)
|
||||
if (compositeAlerts().IsNull())
|
||||
return;
|
||||
|
||||
Standard_Mutex::Sentry aSentry (myMutex);
|
||||
|
||||
compositeAlerts()->Clear (theGravity);
|
||||
myAlertLevels.Clear();
|
||||
}
|
||||
@@ -273,6 +281,8 @@ void Message_Report::Clear (const Handle(Standard_Type)& theType)
|
||||
if (compositeAlerts().IsNull())
|
||||
return;
|
||||
|
||||
Standard_Mutex::Sentry aSentry (myMutex);
|
||||
|
||||
compositeAlerts()->Clear (theType);
|
||||
myAlertLevels.Clear();
|
||||
}
|
||||
|
Reference in New Issue
Block a user