apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marc Dugger" <mdug...@austin.rr.com>
Subject mutex lock
Date Fri, 22 Nov 2002 14:29:45 GMT
I'm attempting to execute some of the "test" code found in the JXTA project
which utilizes Apache APR.  Several of the test applications are "hanging"
at the same point and, because my C++ is so weak, I have no idea why.  The
code appears to pass the pointer of the same object into the function,
apr_thread_mutex_lock(apr_thread_mutex_t *mutex) of thread_mutex.c.
However, on the second function call, the thread blocks when calling
EnterCriticalSection() and never returns.  Here's the code in

if ( discovery->cm_on ) {
		jxta_cm_create_folder(discovery->cm, (char *) dirname[DISC_PEER],
		jxta_cm_create_folder(discovery->cm, (char *) dirname[DISC_GROUP],
g_keywords); <-- function called.
		jxta_cm_create_folder(discovery->cm, (char *) dirname[DISC_ADV],

...which invokes jxta_cm.c:

jxta_cm_create_folder(Jxta_cm *self, char * folder_name, const char *keys[])
    const char** p;
    Jxta_status status;
    char* full_name;
    Folder* folder;

    apr_thread_mutex_lock (self->mutex);  <-- function called.

	[...code excluded...]

    apr_thread_mutex_unlock (self->mutex);

    return JXTA_SUCCESS;

...which invokes thread_mutex.c of APR:

APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex)
    if (mutex->type == thread_mutex_critical_section) {
        EnterCriticalSection(&mutex->section);  <-- blocks here!!!

I am using the latest CVS code from both APR and Jxta.  Can anyone provide
some insight on this?  Thanks in advance.


View raw message