// 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) {
// 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;