You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by "Steven G. Parker" <sp...@cs.utah.edu> on 2000/03/15 09:24:20 UTC

Deadlock

I am experiencing a deadlock in some of the sample programs when I turn
on -v.  It happens when this section of XMLValidator.cpp (line 154 in 1.1.0)
gets called:
            XMLMutexLock lockInit(&gValidatorMutex());
            if (!getMsgLoader().loadMsg(toEmit, errText, maxChars, text1, text2, text3, text4))

Then, in getMsgLoader (line 125 in my version), the gValidatorMutex gets
locked again:
        XMLMutexLock lockInit(&gValidatorMutex());

which of course, deadlocks the program.

Looking at the three calls to getMsgLoader(), the mutex is always acquired
before getMsgLoader is called, so it would be safe to remove the lock from
getMsgLoader().

Is this the right thing to do?

Steve