public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
* RE: TryEnterCriticalSection on Win98
       [not found] <9572D9DF1070D111AAB400805FFEC9C5FF775C@sota0104.cognos.com>
@ 1999-02-23 17:36 ` Ross Johnson
  0 siblings, 0 replies; only message in thread
From: Ross Johnson @ 1999-02-23 17:36 UTC (permalink / raw)
  To: POSIX threads on Win32

Hi John,

The package uses your code verbatim apart from the additions to
check TryEnterCriticalSection. As I mentioned, the key cleanup for
the primary thread works fine on NT.

The test calls pthread_key_destroy before it exits, and then
checks that the local destroy_key routine is called for each thread
including the primary thread. An earlier test simply included a
printf inside of destroy_key and left cleanup to DllMain. The
problem I'm seeing on Win98 was the motivation for attempting to
take direct control and calling pthread_key_destroy.

I think the GetLastError always returning error number 120 in the
primary thread is strange. Do I interpret that as meaning that
GetLastError is unsupported? (It would only be unsupported in the
primary thread it seems.) Makes me wonder what else behaves
differently there, and in particular, whether there is some
methodology that is meant to be applied when writing primary thread
code.

Anyone?

Ross

On Tue, 23 Feb 1999, Bossom, John wrote:

> Hi Ross,
> 
> My original code should have been explicitly destroying the
> main thread when the DLL terminates through the use of DllMain
> when the DLL_PROCESS_DETACH is received (DLL_THREAD_DETACH for
> all others).
> 
> Beware that, for DllMain, you don't get a DLL_THREAD_ATTACH
> DLL_THREAD_DETACH for the main thread; only a DLL_PROCESS_ATTACH
> DLL_PROCESS_DETACH.
> 
> -----Original Message-----
> From: Ross Johnson [ mailto:rpj@ise.canberra.edu.au ]
> Sent: Tuesday, February 23, 1999 5:29 PM
> To: POSIX threads on Win32
> Subject: RE: TryEnterCriticalSection on Win98
> 
> 
> I'm probably the only one who would be confused by what I wrote
> below, but just to clarify:
> 
> > Now, all this seems to fit with other observations, namely when I
> > run the tsd1.c test, which creates and destroys TSD keys, I was
> > finding that on Win98 the pthread_destroy() was not being called for
> > the main thread key. The test runs fine on WNT.
> 
> pthread_destroy !? What am I saying? I meant to say that the
> destroy_key routine (supplied to pthread_key_create) was not being
> called for the main thread.
> 
> > 
> > Soooo, the obvious question now is, is there actually a "main
> > thread" on Win98? A second obvious question is, how come there
> > aren't thousands of applications breaking on Win98? I MUST be
> > missing something.
> > 
> 
> Ross
> 
> +----------------------+---+
> | Ross Johnson         |   | E-Mail: rpj@ise.canberra.edu.au
> | Info Sciences and Eng|___|
> | University of Canberra   | FAX:    +61 6 2015227
> | PO Box 1                 |
> | Belconnen  ACT    2616   | WWW:    http://willow.canberra.edu.au/~rpj/
> | AUSTRALIA                |
> +--------------------------+
> 
> 

+----------------------+---+
| Ross Johnson         |   | E-Mail: rpj@ise.canberra.edu.au
| Info Sciences and Eng|___|
| University of Canberra   | FAX:    +61 6 2015227
| PO Box 1                 |
| Belconnen  ACT    2616   | WWW:    http://willow.canberra.edu.au/~rpj/
| AUSTRALIA                |
+--------------------------+


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-02-23 17:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <9572D9DF1070D111AAB400805FFEC9C5FF775C@sota0104.cognos.com>
1999-02-23 17:36 ` TryEnterCriticalSection on Win98 Ross Johnson

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).