kopia lustrzana https://github.com/OpenRTX/OpenRTX
Changed stack size of codec2 thread when running under linux to prevent stack smashing from codec2_decode. Stack size is set to the default value from the OS
rodzic
adbd1f070d
commit
44abedce4c
|
@ -317,16 +317,21 @@ static void *decodeFunc(void *arg)
|
|||
|
||||
static void startThread(void *(*func) (void *))
|
||||
{
|
||||
#ifdef _MIOSIX
|
||||
// Set stack size of CODEC2 thread to 16kB.
|
||||
pthread_attr_t codecAttr;
|
||||
pthread_attr_init(&codecAttr);
|
||||
pthread_attr_setstacksize(&codecAttr, 16384);
|
||||
|
||||
#ifdef _MIOSIX
|
||||
// Set priority of CODEC2 thread to the maximum one, the same of RTX thread.
|
||||
struct sched_param param;
|
||||
param.sched_priority = sched_get_priority_max(0);
|
||||
pthread_attr_setschedparam(&codecAttr, ¶m);
|
||||
|
||||
// Start thread
|
||||
pthread_create(&codecThread, &codecAttr, func, NULL);
|
||||
#else
|
||||
pthread_create(&codecThread, NULL, func, NULL);
|
||||
#endif
|
||||
|
||||
pthread_create(&codecThread, &codecAttr, func, NULL);
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue