Hi, > +static void notified_complete_cb(AsyncNotifier *notifier, void *opaque) > +{
There is no need to implement this as callback (unlike the notifier _list_ completion callback). Just have a public notifier_complete() function which async notifiers are supposed to call when done. > void notifier_list_notify(NotifierList *list, void *data) > { > - Notifier *notifier, *next; > + BaseNotifier *notifier, *next; > + bool async = false; > + > + if (notifier_list_async_waiting(list)) { assert(!notifier_list_async_waiting(list)) ? Silently removing entries from the wait_notifier list here is asking for trouble. We should have a notifier_list_cancel() function instead which also calls Notifier->cancel() for all pending async notifiers (implementing that can wait until we have an actual need for it). > +struct BaseNotifier { > struct Notifier > { > + BaseNotifier base; > void (*notify)(Notifier *notifier, void *data); > +struct AsyncNotifier { > + BaseNotifier base; > + void (*notify_async)(AsyncNotifier *notifier, void *data, > + NotifiedCompletionFunc *complete_cb, void *cb_data); I don't see a need for three types here, especially as there will be no difference between notify() and notify_async() prototypes once the notifier completion callback is gone. I'd suggest to just extent Notifier. cheers, Gerd