Milan Zamazal has posted comments on this change. Change subject: virt: add run_async helper ......................................................................
Patch Set 3: (5 comments) Documentation better now, I still suggest some fixes run_async docstring, see the comments. https://gerrit.ovirt.org/#/c/49570/3/vdsm/virt/utils.py File vdsm/virt/utils.py: Line 133: """ Line 134: Execute one callable, `func', in a background thread. Line 135: If `name' is not None, set it as the thread name. Line 136: If `daemon' is True, create a daemon thread. Line 137: If `logger` is set, unhandled exceptions which occurs ... occur Line 138: after the execution is succesfully started will be logged Line 139: on this logger; Otherwise the root logger will be used. Line 140: If `resource' is not None, run_async will acquire it Line 141: before to start the `func' callable, and will Line 134: Execute one callable, `func', in a background thread. Line 135: If `name' is not None, set it as the thread name. Line 136: If `daemon' is True, create a daemon thread. Line 137: If `logger` is set, unhandled exceptions which occurs Line 138: after the execution is succesfully started will be logged ... execution _was_ succes_s_fully started ... Line 139: on this logger; Otherwise the root logger will be used. Line 140: If `resource' is not None, run_async will acquire it Line 141: before to start the `func' callable, and will Line 142: release it once `func' exits. Line 135: If `name' is not None, set it as the thread name. Line 136: If `daemon' is True, create a daemon thread. Line 137: If `logger` is set, unhandled exceptions which occurs Line 138: after the execution is succesfully started will be logged Line 139: on this logger; Otherwise the root logger will be used. ... otherwise ... Line 140: If `resource' is not None, run_async will acquire it Line 141: before to start the `func' callable, and will Line 142: release it once `func' exits. Line 143: `resource' must support the threading.Semaphore protocol. Line 137: If `logger` is set, unhandled exceptions which occurs Line 138: after the execution is succesfully started will be logged Line 139: on this logger; Otherwise the root logger will be used. Line 140: If `resource' is not None, run_async will acquire it Line 141: before to start the `func' callable, and will before starting the ... Line 142: release it once `func' exits. Line 143: `resource' must support the threading.Semaphore protocol. Line 144: If `error' is not None, it will be used as argument of Line 145: AsyncStartError. Line 141: before to start the `func' callable, and will Line 142: release it once `func' exits. Line 143: `resource' must support the threading.Semaphore protocol. Line 144: If `error' is not None, it will be used as argument of Line 145: AsyncStartError. AsyncStartError (in case the thread could not be started). Line 146: """ Line 147: starting_error = [None] Line 148: started = threading.Event() Line 149: -- To view, visit https://gerrit.ovirt.org/49570 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icfb405389c465d2a8b8fc8b6f958926d58167a26 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani <from...@redhat.com> Gerrit-Reviewer: Francesco Romani <from...@redhat.com> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Martin Betak <mbe...@redhat.com> Gerrit-Reviewer: Milan Zamazal <mzama...@redhat.com> Gerrit-Reviewer: Tomas Jelinek <tjeli...@redhat.com> Gerrit-Reviewer: gerrit-hooks <automat...@ovirt.org> Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches