freebsd-dev/lib/libkse
Daniel Eischen 02245e6120 Add an i386-specifc hack to always set %gs. There still seems
to be instances where the kernel doesn't  properly save and/or
restore it.

Use noupcall and nocompleted flags in the KSE mailbox.  These
require kernel changes to work which will be committed sometime
later.  Things still work without the changes.

Remove the general kse entry function and use two different
functions -- one for scope system threads and one for scope
process threads.  The scope system function is not yet enabled
and we use the same function for all threads at the moment.

Keep a copy of the KSE stack for the case that a KSE runs
a scope system thread and uses the same stack as the thread
(no upcalls are generated, so a separate stack isn't needed).
This isn't enabled yet.

Use a separate field for the KSE waiting flag.  It isn't
correct to use the mailbox flags field.

The following fixes were provided by David Xu:

  o Initialize condition variable locks with thread versions
    of the low-level locking functions instead of the kse versions.

  o Enable threading before creating the first thread instead
    of after.

  o Don't enter critical regions when trying to malloc/free
    or call functions that malloc/free.

  o Take the scheduling lock when inheriting thread attributes.

  o Check the attribute's stack pointer instead of the
    attributes stack size for null when allocating a
    thread's stack.

  o Add a kseg reinit function so we don't have to destroy and
    then recreate the same lock.

  o Check the return value of kse_create() and return an
    appropriate error if it fails.

  o Don't forget to destroy a thread's locks when freeing it.

  o Examine the correct flags word for checking to see if
    a thread is in a synchronization queue.

Things should now work on an SMP kernel.
2003-04-21 04:02:56 +00:00
..
arch/i386 Sorry folks; I accidentally committed a patch from what I was working 2003-04-18 07:09:43 +00:00
sys Sorry folks; I accidentally committed a patch from what I was working 2003-04-18 07:09:43 +00:00
test For now, build and install this as libkse instead of libpthread. 2002-12-08 22:43:31 +00:00
thread Add an i386-specifc hack to always set %gs. There still seems 2003-04-21 04:02:56 +00:00
Makefile Add an i386-specifc hack to always set %gs. There still seems 2003-04-21 04:02:56 +00:00