multithreading windows and embedding python

freesteel zabaione at uk2.net
Mon Jul 10 12:27:43 EDT 2006


freesteel wrote:
...
> 			pThread[ih] = AfxBeginThread(MyThread, mainThreadState,
> THREAD_PRIORITY_NORMAL, CREATE_SUSPENDED);

...

Here the call to AfxBeginThread is wrong, there is one argument
missing, it should be:

pThread[ih] = AfxBeginThread(MyThread, mainThreadState,
THREAD_PRIORITY_NORMAL, 0, CREATE_SUSPENDED);

Because there are so many default arguments of similar types the
compiler did not notice that I passed 'CREATE_SUSPENDED' as a stack
size, and use the default 'creation' state of 'start right away' for
the thread.

Don't you love default args and types like 'void*' ?

Martin




More information about the Python-list mailing list