Changeset 9bdbc7 for src/UIElements


Ignore:
Timestamp:
Sep 9, 2016, 10:09:47 AM (8 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_StructOpt_integration_tests, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, GeometryObjects, Gui_displays_atomic_force_velocity, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, Ubuntu_1604_changes, stable
Children:
34af97
Parents:
546f7d
git-author:
Frederik Heber <heber@…> (09/01/16 22:09:00)
git-committer:
Frederik Heber <heber@…> (09/09/16 10:09:47)
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

    r546f7d r9bdbc7  
    8282
    8383        dirty = true;
    84   clearing = false;
    8584
    8685  refill();
     
    102101
    103102void QtFragmentList::update(Observable *publisher) {
    104 
     103  boost::unique_lock<boost::mutex> lock(flag_mutex);
    105104  dirty = true;
    106 
    107   // force an update from Qt...
    108   clearing = true;
    109   clear();
    110   clearing = false;
    111   emit changed(); // doesn't work!?!
    112105}
    113106
    114107void QtFragmentList::refill()
    115108{
    116   clearing = true;
     109  boost::unique_lock<boost::mutex> lock(flag_mutex);
    117110  FragmentationResultContainer &fragments =
    118111      FragmentationResultContainer::getInstance();
     
    188181  }
    189182  dirty = false;
    190   clearing = false;
    191183}
    192184
  • src/UIElements/Views/Qt4/QtFragmentList.hpp

    r546f7d r9bdbc7  
    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.