Przemyslaw, > Thank you for the information. > I know the syntax but AFAIR when we were talking about it last time > you said that this function has build in race condition and when thread > terminates before other thread calls DosWaitThread() then this function > fails with error code set to ERROR_INVALID_THREADID. It's the reason > why I added '|| rc == ERROR_INVALID_THREADID' in the line below my TOFIX > note: > > return rc == NO_ERROR || rc == ERROR_INVALID_THREADID; > > I do not have OS2 so I haven't verified it but because the event > interface also has build in race condition when used as conditional > variables then it's highly possible I'm not even surprised. >
In message "Re: [Harbour] Re: 2008-09-18 01:17 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)" I was writing: >> b. there is race condition in using this function because thread >> > can terminate before we call it. >> > > > I'm not sure of this, but I think that if you call it with the ID of a > terminated thread or a thread terminates while you're calling it with its ID > you get back > > 309 ERROR_INVALID_THREADID So, maybe it was just a misunderstanding, anyway: > Current code does not look nice but it's working so I probably > I should replace TOFIX with TOCLEAN or even NOTE to not confuse > users. Of course if you know cleaner solution then of course we > should implement it. I can confirm, my ftpd server (MT and under OS/2) works like a charm, I've tested it with up to 10 clients downloading a directory tree of nearly 2Gbs in a thousand file/folders without problems for several runs. :) > > BTW have you noticed that some OS2 ports of open source projects > like MySQL have exactly the same bug as early Harbour OS2 MT code? > This bug is in PTHREAD emulation code. No, I've never checked, can you point me to some particular case so that I can forward this to the developers/porters; this is a BIG issue. > Looks that it's common that programmers working with other systems > do not expect API which has build race conditions and wrongly > understand the OS2 documentation. > I'm not sure DosWaitThread() has built in race condition, it seems a problem of a not so much clear documentation of the API (which, given IBM stopped developing it nearly 10 years ago!!, is not so surprisingly after all). That said, I cannot refrain, even this time, from thanking you for the outstandig work you did in supporting OS/2 (not to mention the general work in harbour). Best regards. Maurilio. PS. BTW, were it not enough clear, I "love" OS/2 like a child, I don't even know why, but that's it .) -- __________ | | | |__| Maurilio Longo |_|_|_|____| farmaconsult s.r.l. _______________________________________________ Harbour mailing list (attachment size limit: 40KB) [email protected] http://lists.harbour-project.org/mailman/listinfo/harbour
