diff options
author | Alex Gorrod <alexander.gorrod@mongodb.com> | 2017-06-27 12:01:10 +1000 |
---|---|---|
committer | Alex Gorrod <alexander.gorrod@mongodb.com> | 2017-06-27 12:01:10 +1000 |
commit | 95d911ab246e444192f34dc395652dba2653dd3c (patch) | |
tree | 8e7c4692125a841a486607ccfe26e8499bc4c398 /src/conn/conn_handle.c | |
parent | 19cd4d9be2c0fd980c00bb04bc949970002f5cb2 (diff) | |
parent | d139a5d5be1d7ba94130502b379a61a809e66272 (diff) | |
download | mongo-2.9.3.tar.gz |
Merge branch 'mongodb-3.6'2.9.3
Diffstat (limited to 'src/conn/conn_handle.c')
-rw-r--r-- | src/conn/conn_handle.c | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/src/conn/conn_handle.c b/src/conn/conn_handle.c index 287e9ca7b99..2f3f9488b58 100644 --- a/src/conn/conn_handle.c +++ b/src/conn/conn_handle.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014-2016 MongoDB, Inc. + * Copyright (c) 2014-2017 MongoDB, Inc. * Copyright (c) 2008-2014 WiredTiger, Inc. * All rights reserved. * @@ -62,14 +62,9 @@ __wt_connection_init(WT_CONNECTION_IMPL *conn) WT_RET(__wt_spin_init(session, &conn->turtle_lock, "turtle file")); /* Read-write locks */ - __wt_rwlock_init(session, &conn->dhandle_lock); - __wt_rwlock_init(session, &conn->hot_backup_lock); - __wt_rwlock_init(session, &conn->table_lock); - - WT_RET(__wt_calloc_def(session, WT_PAGE_LOCKS, &conn->page_lock)); - for (i = 0; i < WT_PAGE_LOCKS; ++i) - WT_RET( - __wt_spin_init(session, &conn->page_lock[i], "btree page")); + WT_RWLOCK_INIT_TRACKED(session, &conn->dhandle_lock, dhandle); + WT_RET(__wt_rwlock_init(session, &conn->hot_backup_lock)); + WT_RWLOCK_INIT_TRACKED(session, &conn->table_lock, table); /* Setup the spin locks for the LSM manager queues. */ WT_RET(__wt_spin_init(session, @@ -81,15 +76,8 @@ __wt_connection_init(WT_CONNECTION_IMPL *conn) WT_RET(__wt_cond_alloc( session, "LSM worker cond", &conn->lsm_manager.work_cond)); - /* - * Generation numbers. - * - * Start split generations at one. Threads publish this generation - * number before examining tree structures, and zero when they leave. - * We need to distinguish between threads that are in a tree before the - * first split has happened, and threads that are not in a tree. - */ - conn->split_gen = 1; + /* Initialize the generation manager. */ + __wt_gen_init(session); /* * Block manager. @@ -113,7 +101,6 @@ void __wt_connection_destroy(WT_CONNECTION_IMPL *conn) { WT_SESSION_IMPL *session; - u_int i; /* Check there's something to destroy. */ if (conn == NULL) @@ -144,9 +131,6 @@ __wt_connection_destroy(WT_CONNECTION_IMPL *conn) __wt_spin_destroy(session, &conn->schema_lock); __wt_rwlock_destroy(session, &conn->table_lock); __wt_spin_destroy(session, &conn->turtle_lock); - for (i = 0; i < WT_PAGE_LOCKS; ++i) - __wt_spin_destroy(session, &conn->page_lock[i]); - __wt_free(session, conn->page_lock); /* Free allocated memory. */ __wt_free(session, conn->cfg); |