-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce ddsrt_abort
and ddsrt_exit
#1877
base: master
Are you sure you want to change the base?
Introduce ddsrt_abort
and ddsrt_exit
#1877
Conversation
This will consolidate abort calls. This will make it easy to override, change, or suppress the abort feature. Borrowing a bit of structure from Rust, the new `ddsrt_abort` was placed inside ddsrt::process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @poetinger, I do see the practical value of not calling abort()
directly but putting something in between if one is using an embedded platform — at least I have found something of the sort useful in the past 🙂.
So that's the good bit.
The bad bit is that not all the abort
s in the core code have been replaced, for example src/core/cdr/src/dds_cdrstream_keys.part.c
have a bunch left.
Not replacing abort
in all locations (like tests) is a defensible choice, but I think it only makes life more complicated to sometimes use abort
and sometimes use ddsrt_abort
: now one has to decide which one to use. So I think all should be replaced and only a single call to abort
should remain, in ddsrt_abort
.
The subject of exit
is another story. Cyclone DDS comes in multiple parts: the core bit is a library—this should never terminate and so should never call exit
to begin with, and it doesn't—and then there are some tools/examples/tests that use it. I don't quite see why something like ddsperf
can't just call exit
.
So unless you have a good argument why exit
must be avoided at all cost, I'd take out the 11 changes related to it.
Sounds reasonable to me. I'll remove |
Signed-off-by: Philip Oetinger <[email protected]>
From feedback comment, it really is unnecessary. Signed-off-by: Philip Oetinger <[email protected]>
743e592
to
a86760a
Compare
This pull request:
ddsrt_abort
andddsrt_exit
abort
withddsrt_abort
inddsc
,ddsrt
,cdr
, andddsi