forked from Alepha/Alepha
Fix stalls due to lacking custom terminal notifications.
`Dropbox` and `Mailbox` should be roughly the same interface, but with different stall semantics. However, terminal operations don't wait. `finish( custom )` should be a handoff without wait. `Dropbox`'s primary thread-coordination works in terms of an acquire/release semantic whereby `release` doesn't block, so this naturally works. However, `Mailbox` works in terms of the `Interlock` primitive which allows for a terminal-case `checkpoint`. Therefore `finish( custom )` has to call the `checkpoint` api in `Mailbox`
This commit is contained in:
@ -153,10 +153,18 @@ namespace Alepha::Hydrogen::Atomic ::detail:: Dropbox_m
|
||||
sendoff();
|
||||
}
|
||||
|
||||
void
|
||||
finish( auto newNotification )
|
||||
{
|
||||
auto &preparing= drops.producer.acquireBox();
|
||||
preparing.notification= std::make_exception_ptr( std::move( newNotification ) );
|
||||
sendoff();
|
||||
}
|
||||
|
||||
void
|
||||
finish()
|
||||
{
|
||||
notify( build_exception< FinishedCondition >( "" ) );
|
||||
finish( build_exception< FinishedCondition >( "" ) );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user