Skip to content

Commit

Permalink
comment on a problem with timer deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Killat committed Jun 4, 2020
1 parent 470c648 commit 5711324
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions include/timeout_condition_variable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,10 @@ class TimeoutConditionVariable

} while (!predicateResult); //if there is a spurious wake up we release the lock and wait again

//the node was already removed by the notify or the timeout call, so it can be safely deleted

//also deletes the timer, if any (no ...this is a big todo, how to deal with the timer deletion)
//the node was already removed from the list by the notify or the timeout call, so it can be safely deleted
//even if the other still fires, it will find no node in the list and thus not work on deleted data
//TODO: but, in principle, it seems it could work on a newly created node on the heap with the same address,
//which would not be correct (kind of an ABA problem with pointers...)

std::cout << "deleting node " << node << std::endl;
delete node;
Expand Down

0 comments on commit 5711324

Please sign in to comment.