delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/05/01/14:38:04

From: greggj AT savvis DOT com (Gregg Jensen)
Subject: waiting on threads
1 May 1997 14:38:04 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <3.0.1.32.19970430112518.00918240.cygnus.gnu-win32@mail.savvis.com>
Mime-Version: 1.0
X-Sender: greggj AT mail DOT savvis DOT com
X-Mailer: Windows Eudora Light Version 3.0.1 (32)
Original-To: gnu-win32 AT cygnus DOT com
Original-Sender: owner-gnu-win32 AT cygnus DOT com

Ok, I have added the use of threads in my program (instead
of forking, which I could not get to work, but that is
another issue...), and for the most part it works as
advertised.  I lay out 6 threads and then call 
WaitForMultipleObjects passing the variable hThread
(which is defined as hThread[7]).  The handle from each
CreateThread is put into an empty spot in the hThread
array.  When I call WaitForMultipleObjects, I get an
error of INVALID_HANDLE_ERROR (or whatever 6 is).  I then
went through the array one at a time with WaitForSingleObject
and found that the fourth and fifth one were invalid, but
the rest were OK.  This is a little test prototype so there
is not much going on, but I am curious to know if anyone,
who has been using the native threads, has had any problems
(other then the debugging problem from Bruce McLeod), with
these functions?

Gregg Jensen
greggj AT savvis DOT com

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019