Skip to content

Commit

Permalink
* Reverting change to send_modifieds to lock the map mutex around the…
Browse files Browse the repository at this point in the history
… transport mutex (#122)
  • Loading branch information
jredmondson committed Oct 11, 2018
1 parent 7bfa666 commit 5feef55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/madara/knowledge/KnowledgeBaseImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,15 +394,15 @@ int KnowledgeBaseImpl::send_modifieds(
{
int result = 0;

MADARA_GUARD_TYPE guard(transport_mutex_);
MADARA_GUARD_TYPE map_guard(map_.mutex_);
MADARA_GUARD_TYPE transport_guard(transport_mutex_);

if (transports_.size() > 0 && !settings.delay_sending_modifieds)
{
KnowledgeMap modified;

// get the modifieds and reset those that will be sent, atomically
{
MADARA_GUARD_TYPE guard(map_.mutex_);
modified = map_.get_modifieds_current(settings.send_list, true);
}

Expand Down

0 comments on commit 5feef55

Please sign in to comment.