On 10 July 2012 07:54, Peter Crosthwaite
<peter.crosthwa...@petalogix.com> wrote:
> Constantly bouncing back is safer however. If you hang on to an
> in-place pointer into the FDT (as returned by get_prop) and someone
> comes along and set_props() then your pointer is corrupted. Ive been
> snagged before by doing exactly this and eventually came to the
> brute-force approach of just requerying the DTB every touch rather
> than try to work with pointers to arrays. duping the property could
> work, but its a bit of a mess trying to free the returned copies.

Incidentally, if you have two separate bits of code both accessing
the DTB in parallel then this sounds like a really weird corner case
use. I would expect that the standard thing would be "at startup
we read the DTB, modify it slightly and after that ignore it",
all of which should be straightforward single threaded code with
no particular control flow/threading/coroutine issues.

-- PMM

Reply via email to