Luigi Rizzo wrote: > yes there is -- ast_mutex_init() first checks if > (head)->lock == AST_MUTEX_INIT_VALUE, and if not it complains > that the mutex has been already initialized.
This is only true when DEBUG_THREADS is enabled for the compile. In spite of that, I don't see how this was ever expected to work for structures that are allocated using calloc() anyway, since the mutex will clearly not have this initial value. Your change may help one case of this, but there are lots of other places in the code where we allocate structures and then initialize locks inside them. I suspect the proper change is to revert this one, and then modify __ast_pthread_mutex_init_attr() to only complain if the mutex value is not PTHREAD_MUTEX_INITIALIZER and is _also_ not zero. _______________________________________________ --Bandwidth and Colocation provided by Easynews.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
