make thread work when system is not busy

Vadim Zeitlin vadim at wxwidgets.org
Fri Sep 7 17:05:02 PDT 2007


On Tue, 4 Sep 2007 10:10:51 +0200 (CEST) koen at vermeer.tv wrote:

> >  Looking at the code, SetPriority() should in fact be called before
> > Create() and not only before Run(). If it's called on a running thread
> > then
> > it indeed just changes the priority of the current thread instead which is
> > questionably useful...
> 
> Just to be sure:
>  - Does this apply to all ports?

 No, in wxMSW SetPriority() shouldn't have these limitations.

>  - Does this mean the sample (threads.cpp) is also wrong?

 Yes, unfortunately it is. I don't know what would be the best thing to do
to fix it immediately though.

>  - Does this mean that you can use SetPriority() to either set the
> priority of a new thread when calling it before Create(), or to set the
> priority of the calling thread when calling it at any other stage? So, in
> the latter case, the created thread can just change its own priority, for
> example in the Entry() function?

 I didn't test it but it should work.

 Regards,
VZ

-- 
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/





More information about the wx-users mailing list