RES: RTEMS with C++
Joel Sherrill
joel.sherrill at oarcorp.com
Thu Oct 19 19:35:56 UTC 2006
Fabrício de Novaes Kucinskis wrote:
> Hi Chris,
>
>
>> I tend to look at classes and threads in the opposite way. I write a
>> class for a specific purpose and if it needs a thread I embed one in
>> that class where a member function is the thread body.
>>
>
> And how do you do this? Do you pass a method of an object as the entry point
> for a task?
>
> I tried this:
>
> rtems_task_start(id, MyObj.Method, 0);
>
> Where 'Method' is defined in the class definition as:
>
> rtems_task Method(rtems_task_argument);
>
> But it didn't work. The compiler argues that there's "no matches converting
> function 'Method' to type 'rtems_task'".
>
>
I am sure there are better methods but the simplest one I have found is
to have a
static function that is the thread. It can take a single argument which
somehow
helps it find a pointer to the instance and then call a member function
to really
be the thread body.
> What I'm doing wrong?
>
> Thanks in advance,
>
>
> Fabrício.
>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users
>
More information about the users
mailing list