Project

General

Profile

Actions

Bug #176

closed

Missing symbol in lwkt_thread.c

Added by wa1ter almost 18 years ago. Updated over 17 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

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?

Actions #1

Updated by dillon over 18 years ago

:
: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?

It's just an SMP vs non-SMP build issue.  lwkt_getalltokens()
and lwkt_relalltokens() need to exist for both builds and
they don't. I'll get the UP build working again.
-Matt
Matthew Dillon
<>
Actions #2

Updated by dillon over 18 years ago

:
: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.
-Matt
Matthew Dillon
<>
Actions

Also available in: Atom PDF