linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Eduardo Gomez Noguera <davidgn@servidor.unam.mx>
To: linux c programming <linux-c-programming@vger.kernel.org>
Subject: signaling a thread to stop
Date: 14 Apr 2002 09:38:02 -0600	[thread overview]
Message-ID: <1018798684.4455.17.camel@hikaru> (raw)

Hello.
I am writting a gtk program that comunicates with a pen pad. when it
starts writting, it starts doing it in "real time", just as the pen
moves, there is flow of data, so a toggle button creates a thread, and
will need to stop it too.

what is the best way to do it?

i read on libc info page pthread_cancel, but didnt understand what does
it exactly do.
I think it signals the thread, then the thread must tests its value to
see if it has been "canceled" and decide upon an action (after the
thread itself was set to CANCEL_ENABLE)what to do, am i right?

the thread needs to stop comunication with the pad, so it does not keep
sending data, and then flush any remaining data when asked to stop. And
unlock a mutex.

-- 
ICQ: 15605359 Bicho
                                  =^..^=
First, they ignore you. Then they laugh at you. Then they fight you.
Then you win. Mahatma Gandhi.
-------------------------------気検体の一致------------------------------------
暑さ寒さも彼岸まで。
恋にししょうなし。恋はしあんの他。
アン アン アン とっても大好き



             reply	other threads:[~2002-04-14 15:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-14 15:38 David Eduardo Gomez Noguera [this message]
2002-04-14 14:43 ` signaling a thread to stop Glynn Clements

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=1018798684.4455.17.camel@hikaru \
    --to=davidgn@servidor.unam.mx \
    --cc=linux-c-programming@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).