🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #5978

Re: Suspend / resume a thread given only the thread id

#5978
From: Bob Gonder
Date: Wed, 22 Jun 2005 22:44
17 lines
1769 bytes
Helmut Giese wrote:

>Now I need to suspend / resume these threads, which requires the
>handle - which is gone due to the call to CloseHandl.
>Is there any way to suspend / resume a thread given just its 'thread
>id' ?

Help:

The Win32 API does not provide a way to get the thread handle from the
thread identifier. <snip> Instead, you must request the handle from
the thread creator or the thread itself. 
A thread can use the GetCurrentThread function to retrieve a pseudo
handle to its own thread object. This pseudo handle is valid only for
the calling process; it cannot be inherited or duplicated for use by
other processes. To get the real handle to the thread, given a pseudo
handle, use the DuplicateHandle function. 
Technical Details
Message-ID: <p8qjb156539901t2kvkts5fbma41hj3clc@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news2.google.com!newsread.com!news-xfer.newsread.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <42b9c7b5.8689343@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,7fcdd3480d100ea8
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Suspend / resume a thread given only the thread id
Date: Wed, 22 Jun 2005 15:44:46 -0700
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <p8qjb156539901t2kvkts5fbma41hj3clc@4ax.com>
References: <42b9c7b5.8689343@forums.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 67.77.146.41
X-Trace: newsgroups.borland.com 1119480283 67.77.146.41 (22 Jun 2005 15:44:43 -0700)
Lines: 19
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news2.google.com!newsread.com!news-xfer.newsread.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail