After calling pthread_create
function I receive next message:
W/libc (26409): pthread_create sched_setscheduler call failed: Operation not permitted
The code used to create the thread is:
pthread_attr_t threadAttr;
int ret = pthread_attr_init(&threadAttr);
//code to check ret - it's 0
size_t guard_size = 0;
pthread_attr_getguardsize(&threadAttr, &guard_size);
ret = pthread_attr_setstacksize(&threadAttr, myStackSize + guard_size);
//code to check ret - it's 0
ret = pthread_attr_setdetachstate(&threadAttr, PTHREAD_CREATE_DETACHED);
//code to check ret - it's 0
ret = pthread_attr_setschedpolicy(&threadAttr, SCHED_FIFO);
//code to check ret - it's 0
sched_param schedParam;
schedParam.sched_priority = myPriority; //it's 16
ret = pthread_attr_setschedparam(&threadAttr, &schedParam);
//code to check ret - it's 0
// Create the thread
ret = pthread_create(&myHandle, &threadAttr, RunCallback, (void *)myData);
//code to check ret - it's 0
//code to check myHandle - it's > 0
// Delete attribute
pthread_attr_destroy(&threadAttr);
Please note that the message appears in logcat before breakpoint in RunCallback is hit.
Do you know why I have this warning? Is it safe to ignore it - if yes why?
PS: code runs as native activity on Nexus 4 devices with 4.4.2 OS version(build number KOT49H).