summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Hows <howsdav@gmail.com>2016-05-30 17:42:06 +1000
committerAlex Gorrod <alexander.gorrod@mongodb.com>2016-05-30 03:42:06 -0400
commitfa4b0916bcbeca210f98d4dd0ee86fd199050c2b (patch)
tree971b7b294fc7a7a8a63122f8be1ad73f64c8521d
parent4d13c2b911e8ad6a8993704ecd3007af302232a6 (diff)
downloadmongo-fa4b0916bcbeca210f98d4dd0ee86fd199050c2b.tar.gz
WT-2491 Remove the handle close_lock (#2745)
It is no longer necessary, due to other structural code changes.
-rw-r--r--src/conn/conn_dhandle.c9
-rw-r--r--src/include/dhandle.h8
2 files changed, 1 insertions, 16 deletions
diff --git a/src/conn/conn_dhandle.c b/src/conn/conn_dhandle.c
index 5019ab59fe3..3f90c5ee842 100644
--- a/src/conn/conn_dhandle.c
+++ b/src/conn/conn_dhandle.c
@@ -21,7 +21,6 @@ __conn_dhandle_destroy(WT_SESSION_IMPL *session, WT_DATA_HANDLE *dhandle)
__wt_free(session, dhandle->name);
__wt_free(session, dhandle->checkpoint);
__wt_free(session, dhandle->handle);
- __wt_spin_destroy(session, &dhandle->close_lock);
__wt_overwrite_and_free(session, dhandle);
return (ret);
@@ -52,9 +51,6 @@ __conn_dhandle_alloc(WT_SESSION_IMPL *session,
dhandle->handle = btree;
btree->dhandle = dhandle;
- WT_ERR(__wt_spin_init(
- session, &dhandle->close_lock, "data handle close"));
-
__wt_stat_dsrc_init(dhandle);
*dhandlep = dhandle;
@@ -160,7 +156,6 @@ __wt_conn_btree_sync_and_close(WT_SESSION_IMPL *session, bool final, bool force)
* the list of open handles (for example, checkpoint). Acquire the
* handle's close lock.
*/
- __wt_spin_lock(session, &dhandle->close_lock);
/*
* The close can fail if an update cannot be written, return the EBUSY
@@ -200,9 +195,7 @@ __wt_conn_btree_sync_and_close(WT_SESSION_IMPL *session, bool final, bool force)
F_ISSET(dhandle, WT_DHANDLE_DEAD) ||
!F_ISSET(dhandle, WT_DHANDLE_OPEN));
-err: __wt_spin_unlock(session, &dhandle->close_lock);
-
- if (no_schema_lock)
+err: if (no_schema_lock)
F_CLR(session, WT_SESSION_NO_SCHEMA_LOCK);
__wt_evict_file_exclusive_off(session);
diff --git a/src/include/dhandle.h b/src/include/dhandle.h
index 8b313428d06..187017d41e4 100644
--- a/src/include/dhandle.h
+++ b/src/include/dhandle.h
@@ -65,14 +65,6 @@ struct __wt_data_handle {
WT_DATA_SOURCE *dsrc; /* Data source for this handle */
void *handle; /* Generic handle */
- /*
- * Data handles can be closed without holding the schema lock; threads
- * walk the list of open handles, operating on them (checkpoint is the
- * best example). To avoid sources disappearing underneath checkpoint,
- * lock the data handle when closing it.
- */
- WT_SPINLOCK close_lock; /* Lock to close the handle */
-
/* Data-source statistics */
WT_DSRC_STATS *stats[WT_COUNTER_SLOTS];
WT_DSRC_STATS stat_array[WT_COUNTER_SLOTS];