[pacman-dev] download interrupt mechanism

Dave Reisner d at falconindy.com
Tue Aug 25 21:34:51 UTC 2015


On Tue, Aug 25, 2015 at 09:21:50PM +0200, Guillaume wrote:
> To not block the GUI, I run trans_commit function in a g_thread and I can't use SIGINT signal. I have no way to correctly stop curl process. I propose to look for a particular value to do it as transaction functions do with TRANS_STATE_INTERRUPTED.Dave Reisner <d at falconindy.com> a écrit :On Aug 25, 2015 7:04 AM, "Guillaume Benoit" <guillaume at manjaro.org> wrote:

Please don't top post.

Presumably, you can't use SIGINT because you can't guarantee which
thread the signal is delivered to. You need to properly guard against
this situation by blocking SIGINT on threads which aren't the caller of
trans_commit. With only 1 thread not masking SIGINT, the linux kernel
will guarantee delivery to this thread.

http://stackoverflow.com/a/11679770

Is this correct? Or is there some other reason that you can't rely on
signal delivery as an interrupt mechanism?

d


More information about the pacman-dev mailing list