Lines Matching refs:tmgrp

122 	DB_TXNMGR *tmgrp;
140 if ((ret = __os_calloc(1, sizeof(DB_TXNMGR), &tmgrp)) != 0)
144 tmgrp->mutexp = NULL;
145 tmgrp->dbenv = dbenv;
146 tmgrp->recover =
148 tmgrp->flags = LF_ISSET(DB_TXN_NOSYNC | DB_THREAD);
149 TAILQ_INIT(&tmgrp->txn_chain);
152 tmgrp->reginfo.dbenv = dbenv;
153 tmgrp->reginfo.appname = DB_APP_NONE;
155 tmgrp->reginfo.path = NULL;
157 if ((ret = __os_strdup(path, &tmgrp->reginfo.path)) != 0)
159 tmgrp->reginfo.file = DEFAULT_TXN_FILE;
160 tmgrp->reginfo.mode = mode;
161 tmgrp->reginfo.size = TXN_REGION_SIZE(maxtxns);
162 tmgrp->reginfo.dbflags = flags;
163 tmgrp->reginfo.addr = NULL;
164 tmgrp->reginfo.fd = -1;
165 tmgrp->reginfo.flags = dbenv->tx_max == 0 ? REGION_SIZEDEF : 0;
166 if ((ret = __db_rattach(&tmgrp->reginfo)) != 0)
170 tmgrp->region = tmgrp->reginfo.addr;
171 tmgrp->mem = &tmgrp->region[1];
173 if (F_ISSET(&tmgrp->reginfo, REGION_CREATED)) {
174 tmgrp->region->maxtxns = maxtxns;
175 if ((ret = __txn_init(tmgrp->region)) != 0)
178 } else if (tmgrp->region->magic != DB_TXNMAGIC) {
186 if ((ret = __db_shalloc(tmgrp->mem, sizeof(db_mutex_t),
187 MUTEX_ALIGNMENT, &tmgrp->mutexp)) == 0)
193 __db_mutex_init(tmgrp->mutexp, 0);
198 UNLOCK_TXNREGION(tmgrp);
199 *mgrpp = tmgrp;
202 err: if (tmgrp->reginfo.addr != NULL) {
203 if (tmgrp->mutexp != NULL)
204 __db_shalloc_free(tmgrp->mem, tmgrp->mutexp);
206 UNLOCK_TXNREGION(tmgrp);
207 (void)__db_rdetach(&tmgrp->reginfo);
208 if (F_ISSET(&tmgrp->reginfo, REGION_CREATED))
212 if (tmgrp->reginfo.path != NULL)
213 __os_freestr(tmgrp->reginfo.path);
214 __os_free(tmgrp, sizeof(*tmgrp));
243 txn_begin(tmgrp, parent, txnpp)
244 DB_TXNMGR *tmgrp;
250 TXN_PANIC_CHECK(tmgrp);
257 txn->mgrp = tmgrp;
508 txn_close(tmgrp)
509 DB_TXNMGR *tmgrp;
514 TXN_PANIC_CHECK(tmgrp);
524 TAILQ_FIRST(&tmgrp->txn_chain)) != TAILQ_END(&tmgrp->txn_chain))
531 if (tmgrp->dbenv->lg_info &&
532 (t_ret = log_flush(tmgrp->dbenv->lg_info, NULL)) != 0 && ret == 0)
535 if (tmgrp->mutexp != NULL) {
536 LOCK_TXNREGION(tmgrp);
537 __db_shalloc_free(tmgrp->mem, tmgrp->mutexp);
538 UNLOCK_TXNREGION(tmgrp);
541 if ((t_ret = __db_rdetach(&tmgrp->reginfo)) != 0 && ret == 0)
544 if (tmgrp->reginfo.path != NULL)
545 __os_freestr(tmgrp->reginfo.path);
546 __os_free(tmgrp, sizeof(*tmgrp));