[PATCH] osmo-gsm-tester[master]: modem: reset cancellable after cancelling dbus methods

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Thu Oct 5 15:50:08 UTC 2017

Review at  https://gerrit.osmocom.org/4145

modem: reset cancellable after cancelling dbus methods

I first wanted to use "reset" method, but according to [1]:
"The recommended practice is to drop the reference to a
cancellable after cancelling it, and let it die with the outstanding
async operations. You should create a fresh cancellable for further
async operations."

Pretty weird that in other parts of documentation it still says that it
can be used for concurrent events.

[1] https://developer.gnome.org/gio/2.54/GCancellable.html#g-cancellable-reset

Change-Id: I7392275620576fd0037be5b9d9f360a46a4f8312
M src/osmo_gsm_tester/ofono_client.py
1 file changed, 2 insertions(+), 0 deletions(-)

  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/45/4145/1

diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py
index 30e2b55..e301ed6 100644
--- a/src/osmo_gsm_tester/ofono_client.py
+++ b/src/osmo_gsm_tester/ofono_client.py
@@ -502,6 +502,8 @@
         # Cancel op is applied as a signal coming from glib mainloop, so we
         # need to run it and wait for the callbacks to handle cancellations.
+        # once it has been triggered, create a new one for next operation:
+        self.cancellable = Gio.Cancellable.new()
     def power_cycle(self):
         'Power the modem and put it online, power cycle it if it was already on'

To view, visit https://gerrit.osmocom.org/4145
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7392275620576fd0037be5b9d9f360a46a4f8312
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>

More information about the gerrit-log mailing list