diff options
author | Geert Bosch <geert@mongodb.com> | 2014-11-13 17:23:19 -0500 |
---|---|---|
committer | Geert Bosch <geert@mongodb.com> | 2014-11-14 15:42:49 -0500 |
commit | 78923a5dd969e9b9f46d3fe9bdd969ab0d0a3ca2 (patch) | |
tree | 6da276736fc29f8cb64a97ec62b1e3876481b517 /src/mongo/db/concurrency/locker.h | |
parent | 3d754a25fb3a14c4ddd47b5257b86e775fb17091 (diff) | |
download | mongo-78923a5dd969e9b9f46d3fe9bdd969ab0d0a3ca2.tar.gz |
SERVER-16096: Use explicit masking in ResourceId instead of union/bitfields
Also pass ResourceId by value instead of by reference and use static const for
_numLockBuckets to avoid division.
Diffstat (limited to 'src/mongo/db/concurrency/locker.h')
-rw-r--r-- | src/mongo/db/concurrency/locker.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/db/concurrency/locker.h b/src/mongo/db/concurrency/locker.h index c50e7eddcd3..db684c97f9c 100644 --- a/src/mongo/db/concurrency/locker.h +++ b/src/mongo/db/concurrency/locker.h @@ -128,7 +128,7 @@ namespace mongo { * * @return All LockResults except for LOCK_WAITING, because it blocks. */ - virtual LockResult lock(const ResourceId& resId, + virtual LockResult lock(ResourceId resId, LockMode mode, unsigned timeoutMs = UINT_MAX, bool checkDeadlock = false) = 0; @@ -136,7 +136,7 @@ namespace mongo { /** * Downgrades the specified resource's lock mode without changing the reference count. */ - virtual void downgrade(const ResourceId& resId, LockMode newMode) = 0; + virtual void downgrade(ResourceId resId, LockMode newMode) = 0; /** * Releases a lock previously acquired through a lock call. It is an error to try to @@ -145,7 +145,7 @@ namespace mongo { * @return true if the lock was actually released; false if only the reference count was * decremented, but the lock is still held. */ - virtual bool unlock(const ResourceId& resId) = 0; + virtual bool unlock(ResourceId resId) = 0; /** * Retrieves the mode in which a lock is held or checks whether the lock held for a @@ -154,8 +154,8 @@ namespace mongo { * For example isLockHeldForMode will return true for MODE_S, if MODE_X is already held, * because MODE_X covers MODE_S. */ - virtual LockMode getLockMode(const ResourceId& resId) const = 0; - virtual bool isLockHeldForMode(const ResourceId& resId, LockMode mode) const = 0; + virtual LockMode getLockMode(ResourceId resId) const = 0; + virtual bool isLockHeldForMode(ResourceId resId, LockMode mode) const = 0; // These are shortcut methods for the above calls. They however check that the entire // hierarchy is properly locked and because of this they are very expensive to call. |