]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Add file and line numbers for CBDATA_DEBUG for cbdataLock and
authorwessels <>
Wed, 29 Sep 1999 05:48:46 +0000 (05:48 +0000)
committerwessels <>
Wed, 29 Sep 1999 05:48:46 +0000 (05:48 +0000)
cbdataUnlock.

src/cbdata.cc
src/protos.h
src/squid.h

index 34bcfa86824e60e3442d5316805433e3e510ff4a..ec8d743c53f3947598a7d7862895dc2cdb3d8370 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cbdata.cc,v 1.27 1998/12/05 00:54:17 wessels Exp $
+ * $Id: cbdata.cc,v 1.28 1999/09/28 23:48:46 wessels Exp $
  *
  * DEBUG: section 45    Callback Data Registry
  * AUTHOR: Duane Wessels
@@ -167,7 +167,11 @@ cbdataFree(void *p)
 }
 
 void
+#if CBDATA_DEBUG
+cbdataLockDbg(const void *p, const char *file, int line)
+#else
 cbdataLock(const void *p)
+#endif
 {
     cbdata *c;
     if (p == NULL)
@@ -176,10 +180,18 @@ cbdataLock(const void *p)
     debug(45, 3) ("cbdataLock: %p\n", p);
     assert(c != NULL);
     c->locks++;
+#if CBDATA_DEBUG
+    c->file = file;
+    c->line = line;
+#endif
 }
 
 void
+#if CBDATA_DEBUG
+cbdataUnlockDbg(const void *p, const char *file, int line)
+#else
 cbdataUnlock(const void *p)
+#endif
 {
     cbdata *c;
     if (p == NULL)
@@ -189,6 +201,10 @@ cbdataUnlock(const void *p)
     assert(c != NULL);
     assert(c->locks > 0);
     c->locks--;
+#if CBDATA_DEBUG
+    c->file = file;
+    c->line = line;
+#endif
     if (c->valid || c->locks)
        return;
     cbdataReallyFree(c);
index 630239d630c3c6fef94e217703c74963fd399ec1..25a67a4972e503a0ed6e06fc68c5a3d91486bbfc 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: protos.h,v 1.344 1999/08/02 06:18:39 wessels Exp $
+ * $Id: protos.h,v 1.345 1999/09/28 23:48:47 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -113,12 +113,14 @@ extern int GetInteger(void);
 extern void cbdataInit(void);
 #if CBDATA_DEBUG
 extern void cbdataAddDbg(const void *p, CBDUNL *, int, const char *, int);
+extern void cbdataLockDbg(const void *p, const char *, int);
+extern void cbdataUnlockDbg(const void *p, const char *, int);
 #else
 extern void cbdataAdd(const void *p, CBDUNL *, int);
-#endif
-extern void cbdataFree(void *p);
 extern void cbdataLock(const void *p);
 extern void cbdataUnlock(const void *p);
+#endif
+extern void cbdataFree(void *p);
 extern int cbdataValid(const void *p);
 extern CBDUNL cbdataXfree;
 
index fb8727b9ad5480103b13fd4f14397bf278986509..1c42ae6cd1fc13367499e421e23226f1bc0ce3c4 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: squid.h,v 1.193 1999/06/24 20:20:07 wessels Exp $
+ * $Id: squid.h,v 1.194 1999/09/28 23:48:49 wessels Exp $
  *
  * AUTHOR: Duane Wessels
  *
@@ -299,6 +299,8 @@ struct rusage {
 
 #if CBDATA_DEBUG
 #define cbdataAdd(a,b,c)       cbdataAddDbg(a,b,c,__FILE__,__LINE__)
+#define cbdataLock(a)          cbdataLockDbg(a,__FILE__,__LINE__)
+#define cbdataUnlock(a)                cbdataUnlockDbg(a,__FILE__,__LINE__)
 #endif
 
 #if USE_LEAKFINDER