From 29c218f1b44b3ff589df5f433deba89f0c943a0d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 16 Aug 2018 12:46:09 +0200 Subject: [PATCH] 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. --- src/unix/threadpsx.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/unix/threadpsx.cpp b/src/unix/threadpsx.cpp index aac8d1d795..68614fc78a 100644 --- a/src/unix/threadpsx.cpp +++ b/src/unix/threadpsx.cpp @@ -987,14 +987,7 @@ wxThreadInternal::~wxThreadInternal() { } -#ifdef HAVE_PTHREAD_ATTR_SETSTACKSIZE - #define WXUNUSED_STACKSIZE(identifier) identifier -#else - #define WXUNUSED_STACKSIZE(identifier) WXUNUSED(identifier) -#endif - -wxThreadError wxThreadInternal::Create(wxThread *thread, - unsigned int WXUNUSED_STACKSIZE(stackSize)) +wxThreadError wxThreadInternal::Create(wxThread *thread, unsigned int stackSize) { if ( GetState() != STATE_NEW ) { @@ -1002,13 +995,15 @@ wxThreadError wxThreadInternal::Create(wxThread *thread, 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_init(&attr); #ifdef HAVE_PTHREAD_ATTR_SETSTACKSIZE if (stackSize) pthread_attr_setstacksize(&attr, stackSize); +#else + wxUnusedVar(stackSize); #endif #ifdef HAVE_THREAD_PRIORITY_FUNCTIONS