I think that the implementation is racy, especially the Add/Done side.
According to this link https://www.modernescpp.com/index.php/c-core-guidelines-be-aware-of-the-traps-of-condition-variables atomic variable modification should be made under the lock