On 06/25/2010 03:02 AM, Jan Friesse wrote: > Patch fixes following situation: > > 1. objdb receives reload notification and ends in function > object_reload_config. This will call objdb_wrlock. I will call this > thread #1 > 2. Another thread will decide to update corosync statistics and calls > object_key_increment. This calls objdb_rdlock. This thread is #2. But > because > condition (lock_thread != pthread_self()) is satisfied, it will also calls > pthread_rwlock_rdlock. This will blocks, because thread #1 holds the lock. > 3. object_reload_config will call reload functions (as real example > xml2objdb). > xml2objdb needs to calls object_create. This calls objdb_rdlock, but > will hang > on pthread_mutex_lock(&meta_lock), because this lock is held by thread #2. > > -> deadlock > > It is handled by using recursive mutexes. Also every function is locked. >
Honza, good work - looks good for merge exec/timer.c should user this approach as well. > Regards, > Honza > > > > _______________________________________________ > Openais mailing list > [email protected] > https://lists.linux-foundation.org/mailman/listinfo/openais _______________________________________________ Openais mailing list [email protected] https://lists.linux-foundation.org/mailman/listinfo/openais
