> > The thread ID needs to be protected using 'spinlock', since that lock
> > is held when reading it later.  Or maybe cb_serialize would work, as
> > long as thread_id is cleared after the callback returns...
> 
> Point was that if two callbacks are going to run, they should serialize
> before messing with the thread_id.

I agree, it just wasn't clear to me what the synchronization should be given 
its intended usage.  I think we need:

acquire(cb_serialization);
thread_id = GetId()
callback()
thread_id = 0
release(cb_serialization);

Reading thread_id in timer_stop should be okay without additional 
synchronization and timer_stop would always know if it were being invoked from 
the callback.
_______________________________________________
ofw mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw

Reply via email to