summaryrefslogtreecommitdiff
path: root/storage/tokudb/PerconaFT/locktree/locktree.h
diff options
context:
space:
mode:
Diffstat (limited to 'storage/tokudb/PerconaFT/locktree/locktree.h')
-rw-r--r--storage/tokudb/PerconaFT/locktree/locktree.h27
1 files changed, 19 insertions, 8 deletions
diff --git a/storage/tokudb/PerconaFT/locktree/locktree.h b/storage/tokudb/PerconaFT/locktree/locktree.h
index 64171c51b23..1ba7a51b124 100644
--- a/storage/tokudb/PerconaFT/locktree/locktree.h
+++ b/storage/tokudb/PerconaFT/locktree/locktree.h
@@ -41,11 +41,11 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
#include <atomic>
#include <db.h>
-#include <toku_time.h>
#include <toku_pthread.h>
+#include <toku_time.h>
-#include <ft/ft-ops.h> // just for DICTIONARY_ID..
#include <ft/comparator.h>
+#include <ft/ft-ops.h> // just for DICTIONARY_ID..
#include <util/omt.h>
@@ -84,20 +84,31 @@ namespace toku {
omt<lock_request *> pending_lock_requests;
std::atomic_bool pending_is_empty;
toku_mutex_t mutex;
+ bool should_retry_lock_requests;
lt_counters counters;
std::atomic_ullong retry_want;
unsigned long long retry_done;
+ toku_mutex_t retry_mutex;
+ toku_cond_t retry_cv;
+ bool running_retry;
+
+ void init(void);
+ void destroy(void);
};
- // The locktree manager manages a set of locktrees, one for each open dictionary.
- // Locktrees are retrieved from the manager. When they are no longer needed, they
- // are be released by the user.
+ // The locktree manager manages a set of locktrees, one for each open
+ // dictionary. Locktrees are retrieved from the manager. When they are no
+ // longer needed, they are be released by the user.
class locktree_manager {
- public:
+ public:
// param: create_cb, called just after a locktree is first created.
// destroy_cb, called just before a locktree is destroyed.
- // escalate_cb, called after a locktree is escalated (with extra param)
- void create(lt_create_cb create_cb, lt_destroy_cb destroy_cb, lt_escalate_cb escalate_cb, void *extra);
+ // escalate_cb, called after a locktree is escalated (with extra
+ // param)
+ void create(lt_create_cb create_cb,
+ lt_destroy_cb destroy_cb,
+ lt_escalate_cb escalate_cb,
+ void *extra);
void destroy(void);