This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Error modifiying Cyg_Thread class...



Hi all,

I was trying to add an extra field to the class Cyg_Thread (file
thread.cxx) and was getting a strange behavior. The field is a cyg_uint16
and I was adding it to the end of the class definition, right after the
get_unique_id() method. In addition to the variable itself, I was also
adding two accessing functions, one to set and another to get the value of
this variable (something very simple :-)).

After recompiling the code and testing I've noticed that the value I was
setting wasn't being held and when issuing the "get" I was getting a
different value. After struggling for a few hours I changed the variable
definition to the beginning of the class, right after the definition of
the variable unique_id, and everything started working fine.

Can someone explain me why is that?

Sounds like some alignment problem, but it is not clear to me why exactly
it wasn't working...

Thanks,
Cristiano.

------------------------------------------------------------
Cristiano Ligieri Pereira - http://www.ics.uci.edu/~cpereira


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]