Commit 7fcb7c5b authored by Mohcine Chraibi's avatar Mohcine Chraibi

Add flag to SrcManager to mark building update

Source thread updates the Queues, but the building is not updated yet.
That leads, to the same agents will be generated by the sources
and added to the Queue.
The queue will be emptied in the main thread.

Therefore, the source thread should not iterate again, unless the
main thread empties the queues and updated the building pointer
parent 686eac90
This diff is collapsed.
......@@ -91,6 +91,14 @@ public:
*/
bool IsCompleted() const;
/**
* @return true if the building is updated
*
*/
bool IsBuildingUpdated() const;
void SetBuildingUpdated(bool update);
/**
* Return a pointer to the building object
*/
......@@ -170,6 +178,8 @@ private:
/// whether all agents have been dispatched
static bool _isCompleted;
//std::atomic<bool>_isCompleted=false;
// std::atomic<bool>_buildingUpdated=false;
bool _buildingUpdated;
};
#endif /* AGENTSSOURCESMANAGER_H_ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment