DragonFly bugs List (threaded) for 2006-05
Re: Missing symbol in lwkt_thread.c
:lwkt_relalltokens is defined in thread.h, but because
:of an #ifdef in lwkt_thread.c, thread2.h is included
:instead of thread.h. Are these backwards in the #ifdef?
Ouch. It's a bit more complicated then I originally thought. Or
actually, less complicated then I thought.
The token code still has the same semantics as it did before, but
on SMP systems I am using an active spinlock now instead of a
passive per-cpu lock. When I originally coded it I forgot that
the spinlock routines would not work as interlocks on UP builds
(because they are just degenerate NOPs on UP builds).
But, at the same time, on a UP system there is no need to track tokens
on a per-thread basis and no need to have a spinlock or even *DO*
anything when a thread switch occurs. Since by definition a held token
is only 'active' when the thread holding it is running, the only thing
that is needed on a UP system is to check whether a token is being held
by a preempted thread. Neither lwkt_getalltokens() or lwkt_relalltokens()
needs to be called at all on a UP system.
I am cleaning it all up now and will commit a fix shortly.