Commit e8edf1ee authored by Pekka Pessi's avatar Pekka Pessi

Added SU_PORT_ZAPREF() to debugging versions of port reference counts.

darcs-hash:20051007073252-65a35-e1236b5ec6423bb2a36259563e138dfbd2c0530d.gz
parent 8c92e659
......@@ -263,6 +263,12 @@ struct su_port_s {
pthread_rwlock_unlock(p->sup_ref); \
if (pthread_rwlock_trywrlock(p->sup_ref) == 0) su_port_destroy(p); } while(0)
#define SU_PORT_ZAPREF(p, f) do { printf("zapref(%p) by %s\n", (p), f), \
pthread_rwlock_unlock(p->sup_ref); \
if (pthread_rwlock_trywrlock(p->sup_ref) != 0) { \
assert(!"SU_PORT_ZAPREF"); pthread_rwlock_wrlock(p->sup_ref); } \
su_port_destroy(p); } while(0)
#define SU_PORT_INITLOCK(p) \
(pthread_mutex_init((p)->sup_mutex, NULL), printf("init_lock(%p)\n", p))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment