diff options
author | costan <costan@google.com> | 2018-03-16 10:06:35 -0700 |
---|---|---|
committer | Victor Costan <pwnall@chromium.org> | 2018-03-16 10:32:40 -0700 |
commit | 0fa5a4f7b1ad9dc16b705bcad1f3ca913f187325 (patch) | |
tree | 1e90dee838f0acc2c9d9ccb187f79700e83b4518 /db/table_cache.h | |
parent | 8143c12f3fc483b1ba61cdce11f9c1faf6d01bea (diff) | |
download | leveldb-0fa5a4f7b1ad9dc16b705bcad1f3ca913f187325.tar.gz |
Extend thread safety annotations.
This CL makes it easier to reason about thread safety by:
1) Adding Clang thread safety annotations according to comments.
2) Expanding a couple of variable names, without adding extra lines of code.
3) Adding const in a couple of places.
4) Replacing an always-non-null const pointer with a reference.
5) Fixing style warnings in the modified files.
This CL does not annotate the DBImpl members that claim to be protected
by the instance mutex, but are accessed without the mutex being held.
Those members (and their unprotected accesses) will be addressed in
future CLs.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=189354657
Diffstat (limited to 'db/table_cache.h')
-rw-r--r-- | db/table_cache.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/db/table_cache.h b/db/table_cache.h index 8cf4aaf..e9191dc 100644 --- a/db/table_cache.h +++ b/db/table_cache.h @@ -20,7 +20,7 @@ class Env; class TableCache { public: - TableCache(const std::string& dbname, const Options* options, int entries); + TableCache(const std::string& dbname, const Options& options, int entries); ~TableCache(); // Return an iterator for the specified file number (the corresponding @@ -50,7 +50,7 @@ class TableCache { private: Env* const env_; const std::string dbname_; - const Options* options_; + const Options& options_; Cache* cache_; Status FindTable(uint64_t file_number, uint64_t file_size, Cache::Handle**); |