Changeset b1bb35


Ignore:
Timestamp:
Sep 1, 2016, 10:09:00 PM (9 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Gui_Fixes
Children:
e03e9f
Parents:
c40e1f8
Message:

FIX: QtFragmentList controls access to clear() and refill() via mutex.

Location:
src/UIElements/Views/Qt4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Views/Qt4/QtFragmentList.cpp

    rc40e1f8 rb1bb35  
    7373
    7474        dirty = true;
    75   clearing = false;
    7675
    7776  refill();
     
    9392
    9493void QtFragmentList::update(Observable *publisher) {
    95 
     94  boost::unique_lock<boost::mutex> lock(flag_mutex);
    9695  dirty = true;
    97 
    98   // force an update from Qt...
    99   clearing = true;
    100   clear();
    101   clearing = false;
    102   emit changed(); // doesn't work!?!
    10396}
    10497
    10598void QtFragmentList::refill()
    10699{
    107   clearing = true;
     100  boost::unique_lock<boost::mutex> lock(flag_mutex);
    108101  FragmentationResultContainer &fragments =
    109102      FragmentationResultContainer::getInstance();
     
    177170  }
    178171  dirty = false;
    179   clearing = false;
    180172}
    181173
  • src/UIElements/Views/Qt4/QtFragmentList.hpp

    rc40e1f8 rb1bb35  
    1414#endif
    1515
    16 
    1716#include <QtGui/QTreeWidget>
    1817#include "CodePatterns/Observer/Observer.hpp"
    1918
     19#include <boost/thread/mutex.hpp>
     20
    2021#include "Fragmentation/Summation/IndexSet.hpp"
     22
    2123
    2224class FragmentGraph;
     
    5355  //!> index set of the fragment
    5456  std::vector<IndexSet> indexsets;
     57  //!> controls atomic access to flags
     58  boost::mutex flag_mutex;
    5559  //!> flag to indicate that we got an update
    5660  bool dirty;
    57   //!> flag to indicate that we currently clear the view, avoids thread collisions
    58   bool clearing;
    5961};
    6062
Note: See TracChangeset for help on using the changeset viewer.