From c98a44dca3851872cedcf73018f85e3f86e3fd03 Mon Sep 17 00:00:00 2001 From: PeiYong Zhang <peiyongz@apache.org> Date: Fri, 15 Nov 2002 21:58:04 +0000 Subject: [PATCH] Leave thread safety issue to message loader git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@174365 13f79535-47bb-0310-9956-ffa450edef68 --- src/xercesc/internal/XMLScanner.cpp | 18 +++--------------- .../validators/schema/XSDErrorReporter.cpp | 17 +++++------------ 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/src/xercesc/internal/XMLScanner.cpp b/src/xercesc/internal/XMLScanner.cpp index df2f9b7a9..5eda4a8ef 100644 --- a/src/xercesc/internal/XMLScanner.cpp +++ b/src/xercesc/internal/XMLScanner.cpp @@ -1118,13 +1118,9 @@ void XMLScanner::emitError(const XMLErrs::Codes toEmit) const unsigned int msgSize = 1023; XMLCh errText[msgSize + 1]; - // Lock the mutex and load the text + if (!gMsgLoader->loadMsg(toEmit, errText, msgSize)) { - XMLMutexLock lockInit(&gScannerMutex()); - if (!gMsgLoader->loadMsg(toEmit, errText, msgSize)) - { // <TBD> Probably should load a default msg here - } } // @@ -1173,13 +1169,9 @@ void XMLScanner::emitError( const XMLErrs::Codes toEmit const unsigned int maxChars = 2047; XMLCh errText[maxChars + 1]; - // Lock the mutex and load the text + if (!gMsgLoader->loadMsg(toEmit, errText, maxChars, text1, text2, text3, text4)) { - XMLMutexLock lockInit(&gScannerMutex()); - if (!gMsgLoader->loadMsg(toEmit, errText, maxChars, text1, text2, text3, text4)) - { // <TBD> Should probably load a default message here - } } // @@ -1228,13 +1220,9 @@ void XMLScanner::emitError( const XMLErrs::Codes toEmit const unsigned int maxChars = 2047; XMLCh errText[maxChars + 1]; - // Lock the mutex and load the text + if (!gMsgLoader->loadMsg(toEmit, errText, maxChars, text1, text2, text3, text4)) { - XMLMutexLock lockInit(&gScannerMutex()); - if (!gMsgLoader->loadMsg(toEmit, errText, maxChars, text1, text2, text3, text4)) - { // <TBD> Should probably load a default message here - } } // diff --git a/src/xercesc/validators/schema/XSDErrorReporter.cpp b/src/xercesc/validators/schema/XSDErrorReporter.cpp index 057572433..c8febbca3 100644 --- a/src/xercesc/validators/schema/XSDErrorReporter.cpp +++ b/src/xercesc/validators/schema/XSDErrorReporter.cpp @@ -56,6 +56,9 @@ /** * $Log$ + * Revision 1.5 2002/11/15 21:58:04 peiyongz + * Leave thread safety issue to message loader + * * Revision 1.4 2002/11/04 14:49:42 tng * C++ Namespace Support. * @@ -211,14 +214,9 @@ void XSDErrorReporter::emitError(const unsigned int toEmit, msgLoader = gValidMsgLoader; } - // Lock the mutex and load the text + if (!msgLoader->loadMsg(toEmit, errText, msgSize)) { - XMLMutexLock lockInit(&gErrMsgMutex()); - - if (!msgLoader->loadMsg(toEmit, errText, msgSize)) - { // <TBD> Should probably load a default message here - } } if (fErrorReporter) @@ -258,14 +256,9 @@ void XSDErrorReporter::emitError(const unsigned int toEmit, msgLoader = gValidMsgLoader; } - // Lock the mutex and load the text + if (!msgLoader->loadMsg(toEmit, errText, maxChars, text1, text2, text3, text4)) { - XMLMutexLock lockInit(&gErrMsgMutex()); - - if (!msgLoader->loadMsg(toEmit, errText, maxChars, text1, text2, text3, text4)) - { // <TBD> Should probably load a default message here - } } if (fErrorReporter) -- GitLab