mutex_lock function and sasl_set_mutex

Ted Yu <[email protected]>
Newsgroups gmane.comp.security.cyrus.sasl
Message-ID <CALte62w1TXWFMUOaqJtS+bKONqEzBymeMOSbwLU3zP2Jzxf1hg@mail.gmail.com>
Hi,
Looking at sasl_set_mutex function shown
in cyrus-sasl-2.1.26/utils/testsuite.c :

int my_mutex_lock(my_mutex_t *m)
{
    if (m->val != 0)
    {
      fatal("Trying to lock a mutex already locked [single-threaded app]");
    }

Wouldn't calling pthread_mutex_lock() better handle concurrent invocations
of the mutex lock function ?

Thanks
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.