Code review comment for lp:~thomas-voss/process-cpp/fix-death-observer

Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

One observation so far:

518 + if (has_been_created_once.exchange(true))
519 + throw std::runtime_error
520 + {
521 + "DeathObserver::create_once_with_signal_trap: "
522 + "Cannot create more than one instance."
523 + };
524 +
525 + std::unique_ptr<core::posix::ChildProcess::DeathObserver> result
526 + {
527 + new DeathObserverImpl{trap}
528 + };

If line 527 throws (hence the death observer is not created) we can't ever create one as has_been_created_once is already set true (518).

review: Needs Fixing

« Back to merge proposal