Resolved possible dead-lock condition. Memory_Free works with a mutex, if that mutex was locked, it would block and wait for that mutex to release. In threading_removeThread, threading_lock is invoked to prevent thread swapping while removing threads. However, tihs locked was maintained after the thread to be removed was removed from the thread list and when its unused memory was going to be deallocated. This caused memory_free to block while waiting for a mutex and that mutex never being released as it was used in another thread that the kernel was not allowed to switch to due to the threading_lock.
Resolved possible dead-lock condition. Memory_Free works with a mutex, if that mutex was locked, it would block and wait for that mutex to release. In threading_removeThread, threading_lock is invoked to prevent thread swapping while removing threads. However, tihs locked was maintained after the thread to be removed was removed from the thread list and when its unused memory was going to be deallocated. This caused memory_free to block while waiting for a mutex and that mutex never being released as it was used in another thread that the kernel was not allowed to switch to due to the threading_lock.

JeremyWildsmith/DCPUOS,JeremyWildsmith/DCPUOS,JeremyWildsmith/DCPUOS