summaryrefslogtreecommitdiff
path: root/src/lock/lock_region.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lock/lock_region.c')
-rw-r--r--src/lock/lock_region.c43
1 files changed, 31 insertions, 12 deletions
diff --git a/src/lock/lock_region.c b/src/lock/lock_region.c
index 1aae1815..ecc7ba47 100644
--- a/src/lock/lock_region.c
+++ b/src/lock/lock_region.c
@@ -1,7 +1,7 @@
/*-
* See the file LICENSE for redistribution information.
*
- * Copyright (c) 1996, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015 Oracle and/or its affiliates. All rights reserved.
*
* $Id$
*/
@@ -120,13 +120,15 @@ __lock_open(env)
}
/*
- * A process joining the region may have reset the lock and transaction
- * timeouts.
+ * Lock and transaction timeouts will be ignored when joining the
+ * environment, so print a warning if either was set.
*/
- if (dbenv->lk_timeout != 0)
- region->lk_timeout = dbenv->lk_timeout;
- if (dbenv->tx_timeout != 0)
- region->tx_timeout = dbenv->tx_timeout;
+ if (dbenv->lk_timeout != 0 && region->lk_timeout != dbenv->lk_timeout)
+ __db_msg(env, DB_STR("2058",
+"Warning: Ignoring DB_SET_LOCK_TIMEOUT when joining the environment."));
+ if (dbenv->tx_timeout != 0 && region->tx_timeout != dbenv->tx_timeout)
+ __db_msg(env, DB_STR("2059",
+"Warning: Ignoring DB_SET_TXN_TIMEOUT when joining the environment."));
LOCK_REGION_UNLOCK(env);
region_locked = 0;
@@ -396,13 +398,30 @@ __lock_env_refresh(env)
R_ADDR(reginfo, lr->locker_mem_off));
}
- /* Detach from the region. */
- ret = __env_region_detach(env, reginfo, 0);
+ ret = __lock_region_detach(env, lt);
- /* Discard DB_LOCKTAB. */
- __os_free(env, lt);
- env->lk_handle = NULL;
+ return (ret);
+}
+
+/*
+ * __lock_region_detach --
+ *
+ * PUBLIC: int __lock_region_detach __P((ENV *, DB_LOCKTAB *));
+ */
+int
+__lock_region_detach(env, lt)
+ ENV *env;
+ DB_LOCKTAB *lt;
+{
+ int ret;
+ ret = 0;
+ if (lt != NULL) {
+ ret = __env_region_detach(env, &lt->reginfo, 0);
+ /* Discard DB_LOCKTAB. */
+ __os_free(env, lt);
+ env->lk_handle = NULL;
+ }
return (ret);
}