summaryrefslogtreecommitdiff
path: root/lib/DecoderWorkerLock.hpp
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2026-10-09 14:12:49 +0200
committerChristoph Berg <myon@debian.org>2026-10-09 14:12:49 +0200
commit76956486fa7ef52a51d4e56df1e13a9f19a6c93c (patch)
treefe0c394439fdc167d1970372e8998874090854dd /lib/DecoderWorkerLock.hpp
parent0685fcada9f95fe90f70b387cd7d757da8209624 (diff)
parentffc62c792c9a5196cb4ce7a353287dfe20db6524 (diff)
Update upstream source from tag 'upstream/3.3.0_beta1+dfsg'
Update to upstream version '3.3.0~beta1+dfsg' with Debian dir 85037bbb9376721108594b59b54ead82ac6924a3
Diffstat (limited to 'lib/DecoderWorkerLock.hpp')
-rw-r--r--lib/DecoderWorkerLock.hpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/DecoderWorkerLock.hpp b/lib/DecoderWorkerLock.hpp
new file mode 100644
index 00000000..c5b4e0ab
--- /dev/null
+++ b/lib/DecoderWorkerLock.hpp
@@ -0,0 +1,23 @@
+#ifndef WSJTX_DECODER_WORKER_LOCK_HPP
+#define WSJTX_DECODER_WORKER_LOCK_HPP
+
+#include <string>
+
+class DecoderWorkerLock final
+{
+public:
+ explicit DecoderWorkerLock (char const * path) noexcept;
+ ~DecoderWorkerLock ();
+ DecoderWorkerLock (DecoderWorkerLock const&) = delete;
+ DecoderWorkerLock& operator= (DecoderWorkerLock const&) = delete;
+
+ bool tryLock () noexcept;
+ bool busy () const noexcept;
+ std::string errorString () const;
+
+private:
+ int descriptor_ {-1};
+ int error_ {0};
+};
+
+#endif