diff options
author | José Bollo <jose.bollo@iot.bzh> | 2017-09-21 12:34:12 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2017-10-09 14:08:32 +0200 |
commit | 271bb6fc606fc5068a7b7a8f22b0052aca2fb900 (patch) | |
tree | f87588fd0949bb0973bf39f965c82bfeb001da6c /src/afb-evt.c | |
parent | 34fa1fb6de1c449b81b9a19fda21c2963eb57f3f (diff) |
Make afb_event_drop obsolete
The function is now replaced by the function afb_event_unref.
In the same time, the function afb_event_addref is made available.
Change-Id: I9aa30e80e64e82f3b16ab359982337771b287185
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-evt.c')
-rw-r--r-- | src/afb-evt.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/src/afb-evt.c b/src/afb-evt.c index 2bac0837..96366de6 100644 --- a/src/afb-evt.c +++ b/src/afb-evt.c @@ -108,23 +108,22 @@ struct afb_evt_watch { unsigned activity; }; -/* declare functions */ -static void evt_hooked_drop(struct afb_evtid *evtid); - /* the interface for events */ static struct afb_event_itf afb_evt_event_itf = { .broadcast = (void*)afb_evt_evtid_broadcast, .push = (void*)afb_evt_evtid_push, - .drop = (void*)afb_evt_evtid_unref, - .name = (void*)afb_evt_evtid_name + .unref = (void*)afb_evt_evtid_unref, + .name = (void*)afb_evt_evtid_name, + .addref = (void*)afb_evt_evtid_addref }; /* the interface for events */ static struct afb_event_itf afb_evt_hooked_event_itf = { .broadcast = (void*)afb_evt_evtid_hooked_broadcast, .push = (void*)afb_evt_evtid_hooked_push, - .drop = (void*)evt_hooked_drop, - .name = (void*)afb_evt_evtid_hooked_name + .unref = (void*)afb_evt_evtid_hooked_unref, + .name = (void*)afb_evt_evtid_hooked_name, + .addref = (void*)afb_evt_evtid_hooked_addref }; /* head of the list of listeners */ @@ -406,10 +405,6 @@ void afb_evt_evtid_unref(struct afb_evtid *evtid) pthread_mutex_unlock(&listener->mutex); } - /* hook */ - if (evtid->hookflags & afb_hook_flag_evt_drop) - afb_hook_evt_drop(evtid->fullname, evtid->id); - /* free */ pthread_mutex_destroy(&evtid->mutex); free(evtid); @@ -428,13 +423,6 @@ void afb_evt_evtid_hooked_unref(struct afb_evtid *evtid) afb_evt_evtid_unref(evtid); } -static void evt_hooked_drop(struct afb_evtid *evtid) -{ - if (evtid->hookflags & afb_hook_flag_evt_drop) - afb_hook_evt_drop(evtid->fullname, evtid->id); - afb_evt_evtid_unref(evtid); -} - /* * Returns the true name of the 'event' */ |