Hartmut Birr wrote:
Alex Ionescu wrote:
Hartmut Birr wrote:
Hi,
there are three places in the kernel, which does remove wait blocks. They are in KiAbortWaitThread, KiInsertQueue and KiBlockThread. Only in KiBlockThread, Thread->WaitBlockList is set to NULL. Is this the problem?
- Hartmut
Hi,
I have been reading Windows Internals II and Windows Internals 4th Edition and I see that the wait blocks are actually supposed to be a circular list... so there should never really be any "NULL". It's possible I based some previous code on this knowledge, which is now conflicting with the ROS implementation of a null-terminated list. I will change the wait code to use circular lists as documented and post a patch.
Best regards, Alex Ionescu
I think, the real problem isn't if the list is NULL terminated or if the WaitBlockList entry from thread is NULL.
Hmm perhaps not, but it's still an issue I'm going to tackle tonight (last time I tried it failed for mysterious reasons).
The real problem is, KiAbortWaitThread is called for a thread which does not waiting.
Ok, since this happened after my worker thread patch and they use kernel queues, I reviewed their implementation and found a number of important flaws.. wether or not they cause this problem I can't tell for sure, but I've also added a debug print before the KeAbortWaitThread call... let me know if this patch fixes anything or if the dprint shoes that the thread isn't really waiting.
- Hartmut
Best regards, Alex Ionescu