diff options
author | Tilghman Lesher <tilghman@meg.abyt.es> | 2008-07-11 19:53:38 +0000 |
---|---|---|
committer | Tilghman Lesher <tilghman@meg.abyt.es> | 2008-07-11 19:53:38 +0000 |
commit | bead8cd6f09f40804b56ff058a5fb86803a747cf (patch) | |
tree | e45762ea87506d40952facb156ff5d6e964b9627 /include/asterisk/res_odbc.h | |
parent | 9cd11917c5401b4e7d62376ffc9e56b631f68fdd (diff) |
Add some debug code and add a missing release
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@130232 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/res_odbc.h')
-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() |