pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/15660 )

Change subject: add osmo_fsm_inst_watch()
......................................................................


Patch Set 2:

A few notes:

* with my proposal, there's no need for a osmo_gsm_free_cb_remove(), Simply use:
"osmo_fsm_free_cb(fi, NULL, NULL);" and you are done.

* Regarding the "deferred until osmo_select_main_ctx()", I'd be fine with it, 
as long as it doesn't become a hard dependency of osmo_fsm_inst to have a main 
loop. There could be a "osmo_fsm_defer_free_select_ctx(fi, bool defer);", which 
when set to true, instead of deallocating it, ->terminated=true is set instead 
and scheduled to be freed. However, with this option the process may end up 
accessing the terminated (but still allocated) FSM and we'll not notice it with 
ASan.

* I still don't think we need this really specific watch API you presented, at 
least in the libosmocore osmo_fsm API. The API I'm suggesting is pretty similar 
in lines of code and style, and still provides for far more uses (since the 
user can program the cb as he wishes).

So all in all, I still think the free_cb is the best option here tbh.


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/15660
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I4d8306488506c60b4c2fc1c4cb3ac04654db9c43
Gerrit-Change-Number: 15660
Gerrit-PatchSet: 2
Gerrit-Owner: neels <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <[email protected]>
Gerrit-CC: fixeria <[email protected]>
Gerrit-CC: pespin <[email protected]>
Gerrit-Comment-Date: Fri, 04 Oct 2019 18:00:00 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Reply via email to