diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-11 19:53:38 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-11 19:53:38 +0000 |
commit | 03b8be1724117da92bf9bf6e2b43236c94975f73 (patch) | |
tree | e45762ea87506d40952facb156ff5d6e964b9627 /include | |
parent | 34ce9ca0f3b000a0c6c2ac24f6903b90f2873fb2 (diff) |
Add some debug code and add a missing release
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@130232 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/res_odbc.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/asterisk/res_odbc.h b/include/asterisk/res_odbc.h index 8bcd772b2..d90dbba9f 100644 --- a/include/asterisk/res_odbc.h +++ b/include/asterisk/res_odbc.h @@ -40,6 +40,11 @@ struct odbc_obj { SQLHDBC con; /* ODBC Connection Handle */ struct odbc_class *parent; /* Information about the connection is protected */ struct timeval last_used; +#ifdef DEBUG_THREADS + char file[80]; + char function[80]; + int lineno; +#endif unsigned int used:1; unsigned int up:1; AST_LIST_ENTRY(odbc_obj) list; @@ -100,7 +105,12 @@ int ast_odbc_smart_execute(struct odbc_obj *obj, SQLHSTMT stmt) __attribute__ (( * thread which requests it. Note that all connections should be released * when the thread is done by calling odbc_release_obj(), below. */ +#ifdef DEBUG_THREADS +struct odbc_obj *_ast_odbc_request_obj(const char *name, int check, const char *file, const char *function, int lineno); +#define ast_odbc_request_obj(a, b) _ast_odbc_request_obj(a, b, __FILE__, __PRETTY_FUNCTION__, __LINE__) +#else struct odbc_obj *ast_odbc_request_obj(const char *name, int check); +#endif /*! * \brief Releases an ODBC object previously allocated by odbc_request_obj() |