Skip to content

Commit

Permalink
Add ReadWrite locking mechanism on top of Blockchain.
Browse files Browse the repository at this point in the history
This will fix existing locking issues, and provide a foundation to implement
more fine-grained locking mechanisms in future works.
  • Loading branch information
0xFFFC0000 committed Feb 14, 2024
1 parent 059028a commit 73e87fe
Show file tree
Hide file tree
Showing 3 changed files with 400 additions and 100 deletions.
5 changes: 5 additions & 0 deletions contrib/epee/include/syncobj.h
Expand Up @@ -36,6 +36,7 @@
#include <boost/thread/mutex.hpp>
#include <boost/thread/recursive_mutex.hpp>
#include <boost/thread/thread.hpp>
#include <boost/thread/lock_types.hpp>

namespace epee
{
Expand Down Expand Up @@ -157,6 +158,10 @@ namespace epee

#define CRITICAL_REGION_END() }

typedef boost::shared_mutex ReadWriteMutex;
typedef boost::shared_lock<boost::shared_mutex> ReadScope;
typedef boost::unique_lock<boost::shared_mutex> ReadWriteScope;

}

#endif

0 comments on commit 73e87fe

Please sign in to comment.