<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri, sans-serif" size="2">
<div><font color="#1F497D">Sorry , add the Title<font face="Wingdings" size="2">L</font></font></div>
<div><font face="Times New Roman, serif" color="#1F497D"> </font></div>
<div><font face="Tahoma, sans-serif" size="2">_____________________________________________<br>
<b>From:</b> Zhang, Qiang Z <br>
<b>Sent:</b> Thursday, December 16, 2010 11:01 AM<br>
<b>To:</b> 'hughsient@gmail.com'<br>
<b>Cc:</b> 'packagekit@lists.freedesktop.org'<br>
<b>Subject:</b> </font></div>
<div><font face="Times New Roman, serif"> </font></div>
<div><font face="Times New Roman, serif"> </font></div>
<div><font face="Calibri, sans-serif">Hi Richard,</font></div>
<div><font face="Calibri, sans-serif"> </font></div>
<div><font face="Calibri, sans-serif">I want to implemented the cancel API for zypp backend. But have not found the proper way.</font></div>
<div><font face="Calibri, sans-serif"> </font></div>
<div><font face="Calibri, sans-serif">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.</font></div>
<div><font face="Calibri, sans-serif"> </font></div>
<div><font face="Calibri, sans-serif">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.</font></div>
<div><font face="Calibri, sans-serif"> </font></div>
<div><font face="Calibri, sans-serif">Most of the other backends just set the transaction status and do nothing.</font></div>
<div><font face="Calibri, sans-serif"> </font></div>
<div><font face="Calibri, sans-serif">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.</font></div>
<div><font face="Calibri, sans-serif">Then all the backend use thread can call pk_backend_thread_cancel to cancel transaction.</font></div>
<div><font face="Calibri, sans-serif"> </font></div>
<div><font face="Calibri, sans-serif">Or any other method?</font></div>
<div><font face="Calibri, sans-serif"> </font></div>
<div><font face="Calibri, sans-serif"> </font></div>
<div><font face="Calibri, sans-serif">-Thanks</font></div>
<div><font face="Calibri, sans-serif">-Xiaoqiang</font></div>
<div><font face="Times New Roman, serif"> </font></div>
<div><font face="Times New Roman, serif"> </font></div>
</font>
</body>
</html>