🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Does Sleep() in a TThread put the entire Program on hold?

#11779
From: Rodolfo Frino - Macrosoft
Date: Wed, 14 Jan 2004 04:52
25 lines
1851 bytes
"Remy Lebeau (TeamB)" <gambit47.no.spam@no.spam.yahoo.com> wrote in message
news:400346eb$1@newsgroups.borland.com...
>
> "PC Hua" <home-at-huaonline.dot.com> wrote in message
> news:opr1ova71yeb6hof@newsgroups.borland.com...
> > Is that (see subject) true?
>
> No.  It holds up the calling thread only.
>
> > What is the best way to put a TThread to sleep?
>
> By calling Sleep().

This answer could be incorrect if the thread creates any windows. In this
case it will be
a much better design to use either MsgWaitForMultipleObjects() or
MsgWaitForMultipleObjectsEx()
instead of Sleep(), otherwise your system could fall into a deadlock. Please
update your knowledge about
Sleep() from the built-in Windows SDK help files.


"C++ is like a giant dinousaur waiting for an asteroid to hit the Earth",
Rodolfo, 2003
Technical Details
Message-ID: <4004cafd@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <opr1ova71yeb6hof@newsgroups.borland.com> <400346eb$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,fd7e6a3bf57d032f
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-01-13 21:09:44 PST
From: "Rodolfo Frino - Macrosoft" <Microhaven@Atlantis.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <opr1ova71yeb6hof@newsgroups.borland.com> <400346eb$1@newsgroups.borland.com>
Subject: Re: Does Sleep() in a TThread put the entire Program on hold?
Date: Wed, 14 Jan 2004 15:52:13 +1100
Lines: 27
Organization: Microhaven
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 203.206.20.67
Message-ID: <4004cafd@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1074055933 203.206.20.67 (13 Jan 2004 20:52:13 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail