diff options
author | Alexander Chemeris <Alexander.Chemeris@gmail.com> | 2013-07-14 22:45:40 +0400 |
---|---|---|
committer | Alexander Chemeris <Alexander.Chemeris@gmail.com> | 2013-07-16 07:36:17 +0400 |
commit | f1c5b4f76567334a8da7cd2bf36ba854db5e341a (patch) | |
tree | 6a3889c252652ebf1c84be0e008010667ea4adf6 /Transceiver52M/DriveLoop.h | |
parent | 19ae715e7126e6c333874d415f56959eac0e6654 (diff) |
Transceiver52M: Introduce usage counting for DriveLoop and RadioInterface.
The reason is to allow them to be started from any TRX. I.e. they are started
when the first TRX starts and stopped when the last TRX stops.
Diffstat (limited to 'Transceiver52M/DriveLoop.h')
-rw-r--r-- | Transceiver52M/DriveLoop.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Transceiver52M/DriveLoop.h b/Transceiver52M/DriveLoop.h index f396abd..eeabe03 100644 --- a/Transceiver52M/DriveLoop.h +++ b/Transceiver52M/DriveLoop.h @@ -45,10 +45,12 @@ //#define TRANSMIT_LOGGING 1 /** The Transceiver class, responsible for physical layer of basestation */ -class DriveLoop : public Thread { +class DriveLoop : private Thread { private: + int mUseCount; ///< Use counter + GSM::Time mTransmitLatency; ///< latency between basestation clock and transmit deadline clock GSM::Time mLatencyUpdateTime; ///< last time latency was updated GSM::Time mLastClockUpdateTime; ///< last time clock update was sent up to core @@ -110,6 +112,11 @@ public: /** Destructor */ ~DriveLoop(); + /** Increase usage counter and start the thread if not started yet */ + bool start(); + /** Decrease usage counter and stop the thread if no users left */ + bool stop(); + VectorQueue *priorityQueue(int m) { return &mTransmitPriorityQueue[m]; } /** Codes for burst types of received bursts*/ |