micke wrote:
>> ***CODE***
>> void *t_thread(void *p){ some work }
>>
>> rtparms_t rtp;
>> struct sched_param sp;
>> pthread_t t_1;
>>
>> //Setting some params to rtp;
>>
>> pthread_create(&t_1, NULL, t_thread, NULL);
>> sp.sched_priority = 100;
>> pthread_setschedparam(t_1, SCHED_FIFO, &sp);
>> //Want to have RT-class prio 100
>>
>> //Then I want to change the parameters of the thread
>> I just created to the ones in rtp.
>>
>> printf("\n**priocntl: %d\n", priocntl(P_LWPID, t_1,
>> PC_SETPARMS, &rtp));
>> printf("Errno: %d\n", errno);
>> ***CODE***
>>
>> So I want to, via priocntl: change the parameters of
>> a thread I just created and also put this thread in
>> the RT class with prio 100.
>>
>> What am I doing wrong here? priocntl returns -1 and
>> errno is 22.
>
> no one know?
Deciphering '22' into something human-readable, I get EINVAL.
Looking at the arguments to priocntl, I see you've chosen P_LWPID.
priocntl(2) says that P_LWPID means you're passing in an LWP ID (not
surprisingly). What you're passing is the result of pthread_create(), which is
a "pthread_t". What justification is there for assuming that a pthread_t is
identical to an LWP ID?
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code