|
|
@ -1,7 +1,6 @@
|
|
|
|
#pragma once
|
|
|
|
#pragma once
|
|
|
|
#include <unordered_set>
|
|
|
|
#include <unordered_set>
|
|
|
|
#include <string>
|
|
|
|
#include <string>
|
|
|
|
#include <atomic>
|
|
|
|
|
|
|
|
#include <ColorText.h>
|
|
|
|
#include <ColorText.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DFHack {
|
|
|
|
namespace DFHack {
|
|
|
@ -11,10 +10,10 @@ namespace DFHack {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
class Lock
|
|
|
|
class Lock
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::atomic_bool locked{};
|
|
|
|
bool locked = false;
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
const std::string name;
|
|
|
|
const std::string name;
|
|
|
|
explicit Lock(const char* name) : name(name){ locked = false; }
|
|
|
|
explicit Lock(const char* name) : name(name){}
|
|
|
|
virtual ~Lock()= default;
|
|
|
|
virtual ~Lock()= default;
|
|
|
|
virtual bool isAnyLocked() const = 0;
|
|
|
|
virtual bool isAnyLocked() const = 0;
|
|
|
|
virtual bool isOnlyLocked() const = 0;
|
|
|
|
virtual bool isOnlyLocked() const = 0;
|
|
|
|