quickstep-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbdeshm...@apache.org
Subject [48/73] [abbrv] incubator-quickstep git commit: reinterpreted byte to SpinMutex before locking. This removes the need to have an additional function accepting a pointer in the SpinMutex class
Date Tue, 06 Sep 2016 20:16:25 GMT
reinterpreted byte to SpinMutex before locking. This removes the need to have an additional
function accepting a pointer in the SpinMutex class


Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/3c4e2ab0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/3c4e2ab0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/3c4e2ab0

Branch: refs/heads/partitioned-aggregation
Commit: 3c4e2ab038c7ffea35030502419764c7f21ba616
Parents: e269e03
Author: rathijit <rathijit@node-2.aggregation.quickstep-pg0.wisc.cloudlab.us>
Authored: Sun Aug 14 19:54:50 2016 -0500
Committer: Harshad Deshmukh <hbdeshmukh@apache.org>
Committed: Tue Sep 6 10:39:59 2016 -0500

----------------------------------------------------------------------
 storage/FastHashTable.hpp | 12 ++++++------
 threading/SpinMutex.hpp   |  2 --
 2 files changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/3c4e2ab0/storage/FastHashTable.hpp
----------------------------------------------------------------------
diff --git a/storage/FastHashTable.hpp b/storage/FastHashTable.hpp
index 8d8d82b..c659a20 100644
--- a/storage/FastHashTable.hpp
+++ b/storage/FastHashTable.hpp
@@ -1900,7 +1900,7 @@ bool FastHashTable<resizable, serializable, force_key_copy, allow_duplicate_keys
         SpinSharedMutexSharedLock<true> resize_lock(resize_shared_mutex_);
         uint8_t *value = upsertCompositeKeyInternalFast(key, init_value_ptr, variable_size);
         if (value != nullptr) {
-            SpinMutex lock(value);
+            SpinMutexLock lock(*(reinterpret_cast<SpinMutex *>(value)));
             for (unsigned int k = 0; k < handles_.size(); ++k) {
                 handles_[k]->mergeStatesFast(source_state + payload_offsets_[k], value
+ payload_offsets_[k]);
             }
@@ -1914,7 +1914,7 @@ bool FastHashTable<resizable, serializable, force_key_copy, allow_duplicate_keys
     if (value == nullptr) {
       return false;
     } else {
-      SpinMutex lock(value);
+      SpinMutexLock lock(*(reinterpret_cast<SpinMutex *>(value)));
       for (unsigned int k = 0; k < handles_.size(); ++k) {
           handles_[k]->mergeStatesFast(source_state + payload_offsets_[k], value + payload_offsets_[k]);
       }
@@ -2017,7 +2017,7 @@ bool FastHashTable<resizable, serializable, force_key_copy, allow_duplicate_keys
               continuing = true;
               break;
             } else {
-              SpinMutex lock(value);
+              SpinMutexLock lock(*(reinterpret_cast<SpinMutex *>(value)));
               for (unsigned int k = 0; k < handles_.size(); ++k) {
                   local.clear();
                   if (argument_ids[k].size()) {
@@ -2044,7 +2044,7 @@ bool FastHashTable<resizable, serializable, force_key_copy, allow_duplicate_keys
         if (value == nullptr) {
           return false;
         } else {
-          SpinMutex lock(value);
+          SpinMutexLock lock(*(reinterpret_cast<SpinMutex *>(value)));
           for (unsigned int k = 0; k < handles_.size(); ++k) {
               local.clear();
               if (argument_ids[k].size()) {
@@ -2170,7 +2170,7 @@ bool FastHashTable<resizable, serializable, force_key_copy, allow_duplicate_keys
               continuing = true;
               break;
             } else {
-              SpinMutex lock(value);
+              SpinMutexLock lock(*(reinterpret_cast<SpinMutex *>(value)));
               for (unsigned int k = 0; k < handles_.size(); ++k) {
                   local.clear();
                   if (argument_ids[k].size()) {
@@ -2201,7 +2201,7 @@ bool FastHashTable<resizable, serializable, force_key_copy, allow_duplicate_keys
         if (value == nullptr) {
           return false;
         } else {
-          SpinMutex lock(value);
+          SpinMutexLock lock(*(reinterpret_cast<SpinMutex *>(value)));
           for (unsigned int k = 0; k < handles_.size(); ++k) {
               local.clear();
               if (argument_ids[k].size()) {

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/3c4e2ab0/threading/SpinMutex.hpp
----------------------------------------------------------------------
diff --git a/threading/SpinMutex.hpp b/threading/SpinMutex.hpp
index 106ef13..5ed1405 100644
--- a/threading/SpinMutex.hpp
+++ b/threading/SpinMutex.hpp
@@ -44,8 +44,6 @@ class SpinMutex {
   SpinMutex() : locked_(false) {
   }
 
-  explicit SpinMutex(uint8_t *ptr): locked_(*ptr) {}
-
   /**
    * @note This call does NOT yield when contended. SpinMutex is intended
    *       mainly for cases where locks are held briefly and it is better to


Mime
View raw message