[packagekit] (no subject)
Daniel Nicoletti
dantti85-pk at yahoo.com.br
Wed Dec 15 19:23:21 PST 2010
Had you take a look on how aptcc handles cancel?
Since zypp is a C++ backend too you can sure
use this way.
First store a pointer in the pk-object to a bool* cancel;
on the pk_cancel() you set cancel = true;
then on the methods you use you do a few checks
if (cancel) { break; } or something...
Best.
________________________________
Daniel Nicoletti - KDE Developer
http://dantti.wordpress.com
When a wicked man dies, his hope perishes;
all he expected from his power comes to nothing. Prov. 11:7
>
>De: "Zhang, Qiang Z" <qiang.z.zhang at intel.com>
>Para: "hughsient at gmail.com" <hughsient at gmail.com>
>Cc: "packagekit at lists.freedesktop.org" <packagekit at lists.freedesktop.org>
>Enviadas: Quinta-feira, 16 de Dezembro de 2010 1:01:12
>Assunto: [packagekit] (no subject)
>
> Hi Richard,
>
>I want to implemented the cancel API for zypp backend. But have not found the
>proper way.
>
>I have reviewed the cancel method of other backends, and found it’s easy to call
>pk_backend_spawn_kill (spawn) if backend use PkBackendSpawn.
>
>But for the backend, which don’t use PkBackendSpawn, it’s complicated to
>implemented this transaction cancel method. Such as poldek, which call poldek’s
>sigint_emit () to cancel transaction and sigint_emit is implemented in poldek
>but not PackageKit.
>
>Most of the other backends just set the transaction status and do nothing.
>
>I think, can PackageKit provide a function pk_backend_thread_cancel in
>pk-backend.c to send signal to the backend thread, the signal handler in thread
>can release some resources then call g_thread_exit to exit.
>Then all the backend use thread can call pk_backend_thread_cancel to cancel
>transaction.
>
>Or any other method?
>
>
>-Thanks
>-Xiaoqiang
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/packagekit/attachments/20101215/e54b942b/attachment-0008.htm>
More information about the PackageKit
mailing list