-
Notifications
You must be signed in to change notification settings - Fork 85
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
Rework owned sample #391
Rework owned sample #391
Conversation
9159306
to
2bf7891
Compare
a058ec5
to
0fadf18
Compare
443bc85
to
afb24bf
Compare
} | ||
return res; | ||
// -- Sample | ||
void _z_owned_sample_move(z_owned_sample_t *dst, const z_owned_sample_t *src) { |
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.
Isn't that a copy more than a move?
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.
We're just copying the pointer, so we're essentially move ownership of the data.
src/collections/fifo_mt.c
Outdated
} | ||
|
||
#if Z_FEATURE_MULTI_THREAD == 1 | ||
res = zp_mutex_init(&fifo->_mutex); |
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.
all the zp_* system calls are deprecated, you should use z_mutex & z_condvar instead
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.
I don't see them in this branch :(
if (res) { | ||
return res; | ||
} | ||
_Z_RETURN_IF_ERR(zp_mutex_init(&fifo->_mutex)) |
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.
Still needs to replace the deprecrated systems calls: https://github.com/eclipse-zenoh/zenoh-pico/blob/main/src/deprecated/platform.c
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.
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.
I suggest to ago ahed with this PR and we then update #394. @jean-roland what do you think?
* Remove ACK message * Cleanup pull and subscriber * Remove Put/Del from ResponseBody * Cleanup flags * Comment unusued variables in pull examples * Fix alignment test * Add ring to collections * Pull examples. Fake z_owned_sample_t * Channels initial commit * Added channel macros * Rename sample_ring to sample_channel_ring * Add fifo and lifo collections * Moved utils to handlers. Added FIFO handlers. Add z_sub_channel. * Improve pull example * Fix return in void functions * Fix prototype * Fix newline at end of the file * Fix windows examples target * Remove unexisting windows z_sub_channel from CMAke * Remove unexisting unix c99 z_sub_channel from CMAke * Rework owned sample (#391) * Owned sample draft * Continue owned sample implementation * [skip ci] Channel macro draft * [skip ci] Fix element copy * Add fifo channel * Add channel clean up and some refactoring/fixes * Syntax fix * Refactoring, cleanup * Rename elem copy to move * Improve naming * TODO resolving * Add channel tests * Apply review feedback * Add encoding copy --------- Co-authored-by: Alexander <[email protected]>
Rework owned sample processing for pull and sub_channel:
fifo_mt
andring_mt
_Z_CHANNEL_DEFINE
z_owned_sample_t
:z_owned_closure_owned_sample_t
z_owned_sample_ring_channel_t
andz_owned_sample_fifo_channel_t
channels(NB: channels for queries and replies will be provided in the separate PR)