Commit 4b85f71e authored by Pekka Pessi's avatar Pekka Pessi

Added more debugging information from SU_PORT_DECREF().

darcs-hash:20051007181821-65a35-51cd40970d339ccac5cbf1ad0294a757611a3098.gz
parent c38dc9fc
......@@ -259,9 +259,11 @@ struct su_port_s {
/* Debugging versions */
#define SU_PORT_INITREF(p) (pthread_rwlock_init((p)->sup_ref, NULL), printf("initref(%p)\n", (p)))
#define SU_PORT_INCREF(p, f) (pthread_rwlock_rdlock(p->sup_ref), printf("incref(%p) by %s\n", (p), f))
#define SU_PORT_DECREF(p, f) do { printf("decref(%p) by %s\n", (p), f), \
pthread_rwlock_unlock(p->sup_ref); \
if (pthread_rwlock_trywrlock(p->sup_ref) == 0) su_port_destroy(p); } while(0)
#define SU_PORT_DECREF(p, f) do { \
pthread_rwlock_unlock(p->sup_ref); \
if (pthread_rwlock_trywrlock(p->sup_ref) == 0) { \
printf("decref(%p) to 0 by %s\n", (p), f); su_port_destroy(p); } \
else { printf("decref(%p) by %s\n", (p), f); } } while(0)
#define SU_PORT_ZAPREF(p, f) do { printf("zapref(%p) by %s\n", (p), f), \
pthread_rwlock_unlock(p->sup_ref); \
......
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