Slightly de-uglify Unix version of wxThreadInternal::Create()
Just use wxUnusedVar() instead of defining and using the ugly WXUNUSED_STACKSIZE() macro. Also change an out of date comment as the thread priority is not the only attribute being changed here. No real changes.
This commit is contained in:
@@ -987,14 +987,7 @@ wxThreadInternal::~wxThreadInternal()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_PTHREAD_ATTR_SETSTACKSIZE
|
wxThreadError wxThreadInternal::Create(wxThread *thread, unsigned int stackSize)
|
||||||
#define WXUNUSED_STACKSIZE(identifier) identifier
|
|
||||||
#else
|
|
||||||
#define WXUNUSED_STACKSIZE(identifier) WXUNUSED(identifier)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
wxThreadError wxThreadInternal::Create(wxThread *thread,
|
|
||||||
unsigned int WXUNUSED_STACKSIZE(stackSize))
|
|
||||||
{
|
{
|
||||||
if ( GetState() != STATE_NEW )
|
if ( GetState() != STATE_NEW )
|
||||||
{
|
{
|
||||||
@@ -1002,13 +995,15 @@ wxThreadError wxThreadInternal::Create(wxThread *thread,
|
|||||||
return wxTHREAD_RUNNING;
|
return wxTHREAD_RUNNING;
|
||||||
}
|
}
|
||||||
|
|
||||||
// set up the thread attribute: right now, we only set thread priority
|
// set up the thread attribute: such as priority and stack size
|
||||||
pthread_attr_t attr;
|
pthread_attr_t attr;
|
||||||
pthread_attr_init(&attr);
|
pthread_attr_init(&attr);
|
||||||
|
|
||||||
#ifdef HAVE_PTHREAD_ATTR_SETSTACKSIZE
|
#ifdef HAVE_PTHREAD_ATTR_SETSTACKSIZE
|
||||||
if (stackSize)
|
if (stackSize)
|
||||||
pthread_attr_setstacksize(&attr, stackSize);
|
pthread_attr_setstacksize(&attr, stackSize);
|
||||||
|
#else
|
||||||
|
wxUnusedVar(stackSize);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_THREAD_PRIORITY_FUNCTIONS
|
#ifdef HAVE_THREAD_PRIORITY_FUNCTIONS
|
||||||
|
Reference in New Issue
Block a user