Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
pthread_attr_t loThreadAttributes;
struct sched_param loThreadSchedulingParameters;
pthread_attr_init(&loThreadAttributes);
pthread_attr_setschedpolicy(&loThreadAttributes, SCHED_RR);
loThreadSchedulingParameters.sched_priority = 1;
pthread_attr_setschedparam(&loThreadAttributes, &loThreadSchedulingParameters);
bool lbResult = pthread_create(ppnHandle, &loThreadAttributes, pfRoutine, poArguments) == 0;
if (lbResult)
{
pthread_detach(*ppnHandle);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.