public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
From: Chris Seaton <chris@chrisseaton.com>
To: pthreads-win32@sources.redhat.com
Subject: How is pthread_self() implemented?
Date: Sun, 31 Aug 2003 17:52:00 -0000	[thread overview]
Message-ID: <1062352346.4373.7.camel@william> (raw)

I'm writing my own (very lightweight) threading library for Windows and
POSIX threads. There are reasons why I can't use pthreads-win32, but
they aren't important here. I'm currently implementing a ThisThread()
routine. With POSIX threads I simply call pthread_self(), but I'm stuck
for Windows.

Originally I called GetCurrentThread(), but that returns a pseudo
handle, so I call DuplicateHandle(), as this pthreads-win32 library
uses.

However, DuplicateHandle() creates a new handle every time it is called,
so I can't compare them. Basically

ThisThread() != ThisThread()

How does the pthreads-win32 library solve this problem?
-- 
Chris Seaton

chris@chrisseaton.com
http://www.chrisseaton.com/

             reply	other threads:[~2003-08-31 17:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-31 17:52 Chris Seaton [this message]
2003-09-01  4:33 ` Ross Johnson
2003-09-01  4:41   ` Will Bryant
2003-09-01  7:22     ` Ross Johnson
2003-09-01 15:49       ` Ross Johnson

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=1062352346.4373.7.camel@william \
    --to=chris@chrisseaton.com \
    --cc=pthreads-win32@sources.redhat.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).