[redland-dev] Threads

Brendan Hahn anarch at silcom.com
Fri Sep 4 18:33:56 CEST 2009


No response to my message of last week, so let me try again.  It's pretty simple: librdf_cache_set_common locks the world mutex, calls librdf_cache_cleanup, which calls librdf_cache_delete, which locks the world mutex.  pthreads mutexes are non-recursive by default, thus deadlock.  So I can fix this by setting PTHREAD_MUTEX_RECURSIVE at init time, but how was this supposed to work?

Further, there's this from librdf_free_cache:
     LIBRDF_FREE(librdf_cache, cache);

   #ifdef WITH_THREADS
     pthread_mutex_unlock(cache->world->mutex);
   #endif

So I'm just not feeling confident about Redland's thread support in general.  Can anyone allay my concerns?



More information about the redland-dev mailing list