Mutex protect L1Encoder::getNextWriteTime. It is called from another thread in GSMCCCH to set the channel start time.

This commit is contained in:
pat
2014-10-14 07:40:58 -07:00
committed by Michael Iedema
parent d1bb8df38c
commit b0737ba490
2 changed files with 19 additions and 4 deletions

View File

@@ -110,6 +110,7 @@ class L1Encoder {
//@}
/**@name Multithread access control and data shared across threads. */
// (pat) It is not being used effectively.
//@{
mutable Mutex mEncLock;
//@}
@@ -127,6 +128,9 @@ class L1Encoder {
GSM::Time mPrevWriteTime; ///< timestamp of previous generated burst
GSM::Time mNextWriteTime; ///< timestamp of next generated burst
// (pat 10-2014) Another thread calls getNextWriteTime so we must protect places that write to mNextWriteTime.
mutable Mutex mWriteTimeLock;
volatile bool mRunning; ///< true while the service loop is running
Bool_z mEncActive; ///< true between open() and close()
Bool_z mEncEverActive; // true if the encoder has ever been active.
@@ -210,7 +214,7 @@ class L1Encoder {
const L1FEC* parent() const { return mParent; }
L1FEC* parent() { return mParent; }
GSM::Time getNextWriteTime() { resync(); return mNextWriteTime; }
GSM::Time getNextWriteTime();
protected: