I'm afraid that with this lock in place there will be no interest in investigating where the real problem lies. We should aspire to be thread safe without locking inside mapserver, and fall back to locking when using third party libraries on which we have no other workaround. just my opinion....