1.1 --- a/libfsclient/lib/src/notifier.cc Fri Feb 17 18:41:18 2023 +0100
1.2 +++ b/libfsclient/lib/src/notifier.cc Sat Feb 18 01:30:37 2023 +0100
1.3 @@ -30,6 +30,7 @@
1.4
1.5 #include "notification_client.h"
1.6 #include "notifier.h"
1.7 +#include "notifier_interface.h"
1.8
1.9
1.10
1.11 @@ -124,7 +125,7 @@
1.12
1.13 ipc_message_open(&msg);
1.14
1.15 - notify_flags_t flags = ipc_message_get_word(&msg, 0);
1.16 + struct in_words_Notifier_notify *in_words = (struct in_words_Notifier_notify *) ipc_message_get_word_address(&msg, 0);
1.17
1.18 /* Reply to notifications. */
1.19
1.20 @@ -133,7 +134,7 @@
1.21
1.22 /* Register the notification. */
1.23
1.24 - _notify(object, flags);
1.25 + _notify(object, in_words->flags, in_words->values);
1.26 }
1.27
1.28 ipc_message_free(&msg);
1.29 @@ -256,7 +257,8 @@
1.30 the generic server dispatch mechanism, with the gate label being interpreted
1.31 and provided as the first parameter. */
1.32
1.33 -void GeneralObjectNotifier::_notify(notifiable_t *object, notify_flags_t flags)
1.34 +void GeneralObjectNotifier::_notify(notifiable_t *object, notify_flags_t flags,
1.35 + notify_values_t values)
1.36 {
1.37 /* Enter critical section for the notifier (affecting all objects). */
1.38
1.39 @@ -275,11 +277,12 @@
1.40
1.41 std::unique_lock<std::mutex> object_guard(state.lock);
1.42
1.43 - /* Record flags and return previous flags. */
1.44 + /* Record flags and note previous flags. */
1.45
1.46 - notify_flags_t recorded = state.pending;
1.47 + notify_flags_t recorded = state.pending_notifications;
1.48
1.49 - state.pending |= flags;
1.50 + state.pending_notifications |= flags;
1.51 + state.pending_values = values;
1.52
1.53 /* Add an object queue entry for any objects without previous notifications. */
1.54
1.55 @@ -291,7 +294,8 @@
1.56 _general_condition.notify_one();
1.57 }
1.58
1.59 -void SpecificObjectNotifier::_notify(notifiable_t *object, notify_flags_t flags)
1.60 +void SpecificObjectNotifier::_notify(notifiable_t *object, notify_flags_t flags,
1.61 + notify_values_t values)
1.62 {
1.63 /* Acquire the lock for state lookup. */
1.64
1.65 @@ -306,7 +310,8 @@
1.66
1.67 std::unique_lock<std::mutex> object_guard(state.lock);
1.68
1.69 - state.pending |= flags;
1.70 + state.pending_notifications |= flags;
1.71 + state.pending_values = values;
1.72
1.73 /* Notify any waiting caller. */
1.74
1.75 @@ -320,12 +325,13 @@
1.76
1.77 bool ObjectNotifier::_transfer(ObjectNotificationState &state, notifiable_t *object)
1.78 {
1.79 - notify_flags_t recorded = state.pending;
1.80 + notify_flags_t recorded = state.pending_notifications;
1.81
1.82 if (recorded)
1.83 {
1.84 object->notifications = recorded;
1.85 - state.pending = 0;
1.86 + object->values = state.pending_values;
1.87 + state.pending_notifications = 0;
1.88 return true;
1.89 }
1.90