Jan Kiszka wrote:
> Gilles Chanteperdrix wrote:
>> Jan Kiszka wrote:
>> The real downside here is a lot of #ifdef clutter. What about the idea
>> of defining an API to abstract the differences between
>> pthread_get/setspecific and __thread and have #ifdef only in one header ?
> Sometimes you only store a value that way, sometimes you also have to
> provide the object that is stored. Then its initialisation is fairly
> specific.
> Everything can be abstracted, but I'm not that optimistic that the
> result will be better readable, just look at the patched users. Or what
> abstractions do you have in mind?

I tried, but I failed. The usage differences in the skins are to
significant to define a generic per-thread wrapper that fits at least a
subset of use cases.

Anyway, I was at least able to eliminate two #ifdefs by converting the
xeno_current_key initialization from pthread_once to a constructor
function (that is under #ifdef anyway). Updates will follow.


Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux

Xenomai-core mailing list

Reply via email to