From 690e61fa4faed1ba452a70a629c7b060ca75d020 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 11 Aug 2023 06:21:58 -0900 Subject: [PATCH] Renamed some more functions and variables that are specific to the bdb_ module. --- .../server/backends/berkeley_db/berkeley_db.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/citadel/server/backends/berkeley_db/berkeley_db.c b/citadel/server/backends/berkeley_db/berkeley_db.c index 552b427ce..40720cf3f 100644 --- a/citadel/server/backends/berkeley_db/berkeley_db.c +++ b/citadel/server/backends/berkeley_db/berkeley_db.c @@ -32,31 +32,31 @@ static DB_ENV *dbenv; // The DB environment (global) // Thread-Specific-Storage items for this backend -struct thread_tsd { +struct bdb_tsd { DB_TXN *tid; // Transaction handle DBC *cursors[MAXCDB]; // Cursors, for traversals... }; pthread_key_t bdb_thread_key; -#define TSD bdb_tsd() +#define TSD bdb_get_tsd() // Return a pointer to our thread-specific (not session-specific) data. -struct thread_tsd *bdb_tsd(void) { +struct bdb_tsd *bdb_get_tsd(void) { - struct thread_tsd *c = (struct thread_tsd *) pthread_getspecific(bdb_thread_key) ; + struct bdb_tsd *c = (struct bdb_tsd *) pthread_getspecific(bdb_thread_key) ; if (c != NULL) { return(c); // Got it. } // If there's no TSD for this thread, it must be a new thread. Create our TSD region. - c = (struct thread_tsd *) malloc(sizeof(struct thread_tsd)); - memset(c, 0, sizeof(struct thread_tsd)); + c = (struct bdb_tsd *) malloc(sizeof(struct bdb_tsd)); + memset(c, 0, sizeof(struct bdb_tsd)); pthread_setspecific(bdb_thread_key, (const void *) c); return(c); } - + // Called by other functions in this module to GTFO quickly if we need to. Not part of the backend API. void bdb_abort(void) { @@ -631,8 +631,7 @@ void bdb_close_cursor(int cdb) { // Prepare for a sequential search of an entire database. -// (There is guaranteed to be no more than one traversal in -// progress per thread at any given time.) +// (There is guaranteed to be no more than one traversal in progress per thread at any given time.) void bdb_rewind(int cdb) { int ret = 0; -- 2.39.2