Ignore:
Timestamp:
Oct 23, 2014, 4:34:39 PM (10 years ago)
Author:
Frederik Heber <heber@…>
Children:
7e6c0d
Parents:
9a4949
git-author:
Frederik Heber <heber@…> (09/03/14 19:26:17)
git-committer:
Frederik Heber <heber@…> (10/23/14 16:34:39)
Message:

Cleaned up use of mutexes in ActionQueue.

  • tempqueue now has its own mutex.
  • more often using lock_guard.
  • run_thread_isIdle has own mutex.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/ActionQueue.hpp

    r9a4949 rfff8fc  
    229229  void insertTempQueue();
    230230
     231  /** Helper to check whether there are more actions in actionqueue for
     232   * run_thread.
     233   *
     234   * \return false - more actions, true - CurrentAction is beyond last action.
     235   */
     236  bool isActionQueueDone() const;
     237
     238  /** Helper to check whether there are more actions in tempqueue for
     239   * run_thread.
     240   *
     241   * \return false - more actions, true - tempqueue is empty
     242   */
     243  bool isTempQueueDone() const;
     244
     245#ifdef HAVE_ACTION_THREAD
     246  /** Getter to run_thread_isIdle wrapped in mutex.
     247   *
     248   * \return true - run_thread is idle, false - it is not
     249   */
     250  bool getrun_thread_isIdle() const;
     251
     252  /** Setter for run_thread_isIdle wrapped in mutex.
     253   *
     254   * \param _run_thread_isIdle new idle status for run_thread
     255   */
     256  void setrun_thread_isIdle(
     257      const bool _run_thread_isIdle);
     258#endif
     259
    231260private:
    232261  /** Private cstor for ActionQueue.
     
    266295#ifdef HAVE_ACTION_THREAD
    267296  //!> internal mutex to synchronize access to queue
    268   boost::mutex mtx_queue;
     297  mutable boost::mutex mtx_actionqueue;
     298
     299  //!> internal mutex to synchronize access to queue
     300  mutable boost::mutex mtx_tempqueue;
    269301
    270302  //!> conditional variable notifying when run_thread is idling
     
    275307
    276308  //!> internal mutex to synchronize access to run_thread_isIdle
    277   boost::mutex mtx_run_thread_isIdle;
     309  mutable boost::mutex mtx_run_thread_isIdle;
    278310#endif
    279311
Note: See TracChangeset for help on using the changeset viewer.