Lines Matching defs:notification

191 /*!	From the specified \a notification, it will remove the lowest pending
196 get_next_pending_event(cache_notification* notification, int32_t* _event)
199 int32_t pending = fssh_atomic_and(&notification->events_pending,
220 cache_notification* notification = cache->pending_notifications.Head();
221 if (notification == NULL)
226 if (!get_next_pending_event(notification, &event)) {
227 // remove the notification if this was the last pending event
228 cache->pending_notifications.Remove(notification);
229 deleteAfterEvent = notification->delete_after_event;
233 // Notify listener, we need to copy the notification, as it might
235 cache_notification copy = *notification;
244 delete notification;
249 /*! Initializes the \a notification as specified. */
252 cache_notification &notification, int32_t events,
255 notification.transaction_id = transaction != NULL ? transaction->id : -1;
256 notification.events_pending = 0;
257 notification.events = events;
258 notification.hook = hook;
259 notification.data = data;
260 notification.delete_after_event = false;
264 /*! Makes sure the notification is deleted. It either deletes it directly,
265 when possible, or marks it for deletion if the notification is pending.
268 delete_notification(cache_notification* notification)
272 if (notification->events_pending != 0)
273 notification->delete_after_event = true;
275 delete notification;
279 /*! Adds the notification to the pending notifications list, or, if it's
281 Also marks the notification to be deleted if \a deleteNotification
286 add_notification(block_cache* cache, cache_notification* notification,
289 if (notification->hook == NULL)
292 int32_t pending = fssh_atomic_or(&notification->events_pending, event);
294 // not yet part of the notification list
297 notification->delete_after_event = true;
298 cache->pending_notifications.Add(notification);
301 delete_notification(notification);