public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2] fzsync: revoke thread_B when parent hit accidental break
Date: Wed, 9 Jan 2019 13:01:30 +0100	[thread overview]
Message-ID: <20190109120129.GA19502@rei> (raw)
In-Reply-To: <874laim6ot.fsf@rpws.prws.suse.cz>

Hi!
> Actually I think the correct way to kill a thread is with
> pthread_cancel.
> 
> AFAICT we could call:
> 
> pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS)
> pthread_setcancelstate(PTHREAD_CANCEL_ENABLE)
> 
> at the start of thread B, then call:
> 
> pthread_cancel(<thread_b_pid>)
> 
> in thread A if we can't rely on setting the exit flag to work
> 
> There are other ways to use pthread_cancel, but this looks like the
> simplest for our use case.

That may work, at least this avoids the need to have a signal handler in
the first place.

But I would still like to push the simpler solution before the release,
i.e. checking for recvmmsg support in the test setup.

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2019-01-09 12:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-08 13:26 [LTP] [PATCH v2] fzsync: revoke thread_B when parent hit accidental break Li Wang
2019-01-08 13:48 ` Cyril Hrubis
2019-01-09  5:18   ` Li Wang
2019-01-09 11:06     ` Richard Palethorpe
2019-01-09 12:01       ` Cyril Hrubis [this message]
2019-01-09 13:32         ` [LTP] [PATCH] Check recvmmsg exists before entering fuzzy loop Richard Palethorpe
2019-01-10  3:39           ` Li Wang
2019-01-10  9:50             ` Richard Palethorpe
2019-01-10  9:59             ` [LTP] [PATCH v2] " Richard Palethorpe
2019-01-11  5:57               ` Li Wang
2019-01-11 11:58               ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190109120129.GA19502@rei \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox