With V0.9.0, all the thread code has been put into a new file, called
src\filesys\xthreads.c
.
All threads are created in krnInitializeXWorkplace
(src\shared\kernel.c
),
which gets called from M_XFldObject::wpclsInitData
, which is probably
the first SOM method called when the WPS is initializing at startup.
All threads have some fntXXXThread
function, which is
the main thread function passed to the thr*
functions in
/helpers/threads.c
when the thread is created.
These in turn create an object window using some fnwpXXXObject
function as their window procedure.
For each thread, we then have some krnPostXXXMsg
function
which posts a message to the corresponding object window. All messages are
defined and explained in include\filesys\xthreads.h
.
The following additional threads are available:
For example, the Worker thread maintains the global linked list of
currently awake Desktop objects. XFldObject::wpObjectReady
post
WOM_ADDAWAKEOBJECT
to the Worker thread, which then adds the object
to that list. (This list is needed by XShutdown to store all the awake
Desktop objects; see the XWorkplace User Guide for details).
The Worker thread runs at "Idle" priority, unless more than 300 messages have piled up in its message queue. In this case, the priority is temporarily raised to "Regular" and set back if the message count goes below 10 again. This can happen when opening folders with a very large number of objects.