[issue4893] Use separate thread support code under MS Windows CE

2009-01-12 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: I see. Whether the call to PyThread_get_thread_ident comes before the access to errno (in the original version) depends on the compiler, of course. Also, this function should be trusted to not affect the last error, since it can't fail. I've

[issue4893] Use separate thread support code under MS Windows CE

2009-01-11 Thread Ulrich Eckhardt
Ulrich Eckhardt eckha...@satorlaser.com added the comment: Okay, the changes necessary to the NT thread code are rather minimal, see attached patch. The file thread_wince.c could then be removed, too. I also removed a comment which was left over from the version before but doesn't apply any

[issue4893] Use separate thread support code under MS Windows CE

2009-01-11 Thread Ulrich Eckhardt
Ulrich Eckhardt eckha...@satorlaser.com added the comment: Okay, hopefully this patch is final. The last one was using 'errno' in debug mode, but under CE using CreateThread() it should use GetLastError(). I also took the liberty of saving that error information for both variants directly after

[issue4893] Use separate thread support code under MS Windows CE

2009-01-11 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: The introduction of int e is redundant now, right? ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4893 ___

[issue4893] Use separate thread support code under MS Windows CE

2009-01-11 Thread Ulrich Eckhardt
Ulrich Eckhardt eckha...@satorlaser.com added the comment: Actually, I made the distinction between the 'int e' and the 'unsigned e' consciously. When using 'errno', using an 'int' is correct. When using GetLastError(), I would have used a win32 DWORD if there was a format sequence that

[issue4893] Use separate thread support code under MS Windows CE

2009-01-11 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Actually, I made the distinction between the 'int e' and the 'unsigned e' consciously. When using 'errno', using an 'int' is correct. When using GetLastError(), I would have used a win32 DWORD if there was a format sequence that

[issue4893] Use separate thread support code under MS Windows CE

2009-01-11 Thread Ulrich Eckhardt
Ulrich Eckhardt eckha...@satorlaser.com added the comment: That's all fine, but why do you need a variable named e in the first place? Can't you leave the code as it was before? There is an intermediate call to a function that retrieves the thread's ID. That function may or may not change

[issue4893] Use separate thread support code under MS Windows CE

2009-01-10 Thread Ulrich Eckhardt
Ulrich Eckhardt eckha...@satorlaser.com added the comment: The thread code is unaffected by the Unicode/ANSI issues, but CE doesn't have _beginthread[ex], which are mandatory for the desktop variants. I have checkin 68455 and I will try to compile the new NT code under CE to estimate how

[issue4893] Use separate thread support code under MS Windows CE

2009-01-09 Thread Ulrich Eckhardt
New submission from Ulrich Eckhardt eckha...@satorlaser.com: There is a separate file thread_wince.h for use with CE, but that is firstly not used due to a missing macro definition and secondly it doesn't compile as it is. The attached patch defines WINCE_THREADS for CE and makes the file at

[issue4893] Use separate thread support code under MS Windows CE

2009-01-09 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: So perhaps it is better to use thread_nt.h now on WinCE? Mark? -- nosy: +loewis, mhammond ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4893

[issue4893] Use separate thread support code under MS Windows CE

2009-01-09 Thread Mark Hammond
Mark Hammond mhamm...@users.sourceforge.net added the comment: Early windows CE devices were very crippled, and IIRC, only the Unicode version of the API existed, and (also IIRC) this was well before Python had builtin unicode. I agree with Martin; it is probably worth investigating how much