Browse Source

Use pthread_attr_setstacksize in JackPosixThread class.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1394 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.62
sletz 19 years ago
parent
commit
1359c7a25a
2 changed files with 9 additions and 0 deletions
  1. +5
    -0
      common/JackPosixThread.cpp
  2. +4
    -0
      common/JackPosixThread.h

+ 5
- 0
common/JackPosixThread.cpp View File

@@ -116,6 +116,11 @@ int JackPosixThread::StartImp(pthread_t* thread, int priority, int realtime, voi
jack_error("Cannot set scheduling priority for RT thread %d %s", res, strerror(errno));
return -1;
}
if ((res = pthread_attr_setstacksize(&attributes, THREAD_STACK))) {
jack_error("setting thread stack size%d %s", res, strerror(errno));
return -1;
}

if ((res = pthread_create(thread, &attributes, start_routine, arg))) {
jack_error("Cannot set create thread %d %s", res, strerror(errno));


+ 4
- 0
common/JackPosixThread.h View File

@@ -27,6 +27,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
namespace Jack
{

/* use 512KB stack per thread - the default is way too high to be feasible
* with mlockall() on many systems */
#define THREAD_STACK 524288

/*!
\brief The POSIX thread base class.
*/


Loading…
Cancel
Save