]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/arducontrol.h
Remove an unused mutex
[r2c2.git] / source / libr2c2 / arducontrol.h
index 555280985767a7e37ea512607a0337359ac11618..01ee2814c6f2bff1f3e52ad11b67070a97e85900 100644 (file)
@@ -117,6 +117,7 @@ private:
 
                bool set(T v) { if(v==pending) return false; pending = v; ++serial; return true; }
                bool commit(unsigned short s) { if(s!=serial) return false; current = pending; return true; }
+               void rollback() { pending = current; ++serial; }
 
                operator T() const { return current; }
        };
@@ -173,6 +174,7 @@ private:
                unsigned address;
                unsigned bits;
                ControlledVariable<unsigned> state;
+               unsigned uncertain;
                unsigned target;
                Msp::Time::TimeDelta active_time;
 
@@ -217,6 +219,7 @@ private:
        public:
                void push(const T &);
                bool pop(T &);
+               bool empty() const;
        };
 
        class Task
@@ -369,6 +372,7 @@ private:
        Msp::FS::Path state_file;
 
        ControlledVariable<bool> power;
+       bool halted;
 
        LocomotiveMap locomotives;
        MfxInfoArray mfx_info;
@@ -380,7 +384,6 @@ private:
 
        SensorMap sensors;
 
-       Msp::Mutex mutex;
        Queue<PendingCommand> command_queue;
        Queue<Tag> completed_commands;
        RefreshTask refresh;
@@ -399,7 +402,7 @@ public:
        virtual void set_power(bool);
        virtual bool get_power() const { return power; }
        virtual void halt(bool);
-       virtual bool is_halted() const { return false; }
+       virtual bool is_halted() const { return halted; }
 
        virtual const char *enumerate_protocols(unsigned) const;
 private: