Renamed some more functions and variables that are specific to the bdb_ module.
authorArt Cancro <ajc@citadel.org>
Fri, 11 Aug 2023 15:21:58 +0000 (06:21 -0900)
committerArt Cancro <ajc@citadel.org>
Fri, 11 Aug 2023 15:21:58 +0000 (06:21 -0900)
citadel/server/backends/berkeley_db/berkeley_db.c

index 552b427ceddbbecfbcefc0c1e9490b251fc4b9f5..40720cf3fea9d9355f489c140c1a9f5e0ce260ff 100644 (file)
@@ -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;