Last active
          March 11, 2020 18:44 
        
      - 
      
- 
        Save rajkumar-p/11a7d3f7e364cecb6b5ca329d6b30b9f to your computer and use it in GitHub Desktop. 
Revisions
- 
        rajkumar-p revised this gist Mar 11, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,7 +16,7 @@ class NodeListWithLock void unlock_node(); }; // Other Methods ... template<typename T> void NodeListWithLock<T>::lock_node() 
- 
        rajkumar-p revised this gist Mar 11, 2020 . 1 changed file with 2 additions and 31 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,18 +16,7 @@ class NodeListWithLock void unlock_node(); }; ... template<typename T> void NodeListWithLock<T>::lock_node() @@ -39,22 +28,4 @@ template<typename T> void NodeListWithLock<T>::unlock_node() { this->_mux.unlock(); } 
- 
        rajkumar-p revised this gist Mar 10, 2020 . 1 changed file with 19 additions and 1 deletion.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -39,4 +39,22 @@ template<typename T> void NodeListWithLock<T>::unlock_node() { this->_mux.unlock(); } template<typename T> class SortedList : public Set<T> { private: NodeListWithLock<T> *_head; public: SortedList(); ~SortedList(); bool add(T elem); bool remove(T elem); bool exists(T elem); unsigned int size(); void print_elements(); }; 
- 
        rajkumar-p created this gist Mar 4, 2020 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,42 @@ template<typename T> class NodeListWithLock { private: T _data; std::mutex _mux; public: NodeListWithLock<T> _next; public: NodeListWithLock(T data); T data(); void lock_node(); void unlock_node(); }; template<typename T> NodeListWithLock<T>::NodeListWithLock(T data) : _data(data), _next(nullptr) { } template<typename T> T NodeListWithLock<T>::data() { return _data; } template<typename T> void NodeListWithLock<T>::lock_node() { this->_mux.lock(); } template<typename T> void NodeListWithLock<T>::unlock_node() { this->_mux.unlock(); }