aboutsummaryrefslogtreecommitdiff
path: root/zenstore/include
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-10-27 21:01:50 +0200
committerGitHub <[email protected]>2021-10-27 21:01:50 +0200
commit3bbb0d326bec3b3379c831b6a4cdc00438ac67f5 (patch)
tree7e94bcb4bb4077aeb68663017695b582ebc9b149 /zenstore/include
parentFixed crash at startup when updating manifest. (diff)
downloadzen-3bbb0d326bec3b3379c831b6a4cdc00438ac67f5.tar.xz
zen-3bbb0d326bec3b3379c831b6a4cdc00438ac67f5.zip
Lockfile implementation (#24)
Implemented lockfile synchronization To be used instead of or in conjunction with existing events to coordinate launching and discovery of server instances
Diffstat (limited to 'zenstore/include')
-rw-r--r--zenstore/include/zenstore/basicfile.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/zenstore/include/zenstore/basicfile.h b/zenstore/include/zenstore/basicfile.h
index 7ae35dea6..e4414787c 100644
--- a/zenstore/include/zenstore/basicfile.h
+++ b/zenstore/include/zenstore/basicfile.h
@@ -12,6 +12,8 @@
namespace zen {
+class CbObject;
+
/**
* Probably the most basic file abstraction in the universe
*
@@ -80,6 +82,22 @@ private:
using BasicFile::Open;
};
+/** Lock file abstraction
+
+ */
+
+class LockFile : protected BasicFile
+{
+public:
+ LockFile();
+ ~LockFile();
+
+ void Create(std::filesystem::path FileName, CbObject Payload, std::error_code& Ec);
+ void Update(CbObject Payload, std::error_code& Ec);
+
+private:
+};
+
ZENCORE_API void basicfile_forcelink();
} // namespace zen