Ignore:
Timestamp:
Oct 23, 2014, 4:33:11 PM (10 years ago)
Author:
Frederik Heber <heber@…>
Children:
9a4949
Parents:
7b38d3
git-author:
Frederik Heber <heber@…> (08/29/14 09:46:02)
git-committer:
Frederik Heber <heber@…> (10/23/14 16:33:11)
Message:

THREADFIX: Fixed ActionQueue with respect to mutex and threads.

  • run_thread is now last member variable, hence started after all other variables are initialized.
  • separated accesses to queues and to run_thread_isIdle flag. Also renamed its mutex for easier association with it.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/ActionQueue.hpp

    r7b38d3 r23b6cf  
    265265
    266266#ifdef HAVE_ACTION_THREAD
     267  //!> internal mutex to synchronize access to queue
     268  boost::mutex mtx_queue;
     269
     270  //!> conditional variable notifying when run_thread is idling
     271  boost::condition_variable cond_idle;
     272
     273  //!> flag indicating whether run_thread is idle or not
     274  bool run_thread_isIdle;
     275
     276  //!> internal mutex to synchronize access to run_thread_isIdle
     277  boost::mutex mtx_run_thread_isIdle;
     278#endif
     279
     280  //!> internal list of status messages from Actions for UIs to display
     281  ActionStatusList StatusList;
     282
     283  // set run_thread to end such that others are initialized first (especially mutexes)
     284#ifdef HAVE_ACTION_THREAD
    267285  //!> internal thread to call Actions
    268286  boost::thread run_thread;
    269 
    270   //!> internal mutex to synchronize access to queue
    271   boost::mutex mtx_queue;
    272 
    273   //!> conditional variable notifying when run_thread is idling
    274   boost::condition_variable cond_idle;
    275 
    276   //!> flag indicating whether run_thread is idle or not
    277   bool run_thread_isIdle;
    278 
    279   //!> internal mutex to synchronize access to run_thread_isIdle
    280   boost::mutex mtx_idle;
    281 #endif
    282 
    283   //!> internal list of status messages from Actions for UIs to display
    284   ActionStatusList StatusList;
     287#endif
    285288};
    286289namespace Queuedetail {
Note: See TracChangeset for help on using the changeset viewer.