Undetected typo

I found if I accidentally use the same Task Handle for two tasks, things don’t work right but the error isn’t caught.

Undetected typo

If I understand correctly, you are suggesting that the handles be initialized before they are used so the kernel knows if they are fresh or not. Task handles are not initialized before they are used, they are in effect just varibles (actually pointers to the TCB when used inside the kernel code), so I’m not sure how the kernel would kno w if you re-use the handle for two things.