X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=Kernel%2Fthreads.c;h=aac6648080f4a64fee10d60c1ece84e36a7cb788;hb=f9c581641afeb556188e84428febd4011e61edc2;hp=f84ca7c20a825bf6c3787219998bc58996c4cb0d;hpb=acc4756d2e22346862ec098be4a18f52846f6dc4;p=tpg%2Facess2.git diff --git a/Kernel/threads.c b/Kernel/threads.c index f84ca7c2..aac66480 100644 --- a/Kernel/threads.c +++ b/Kernel/threads.c @@ -904,14 +904,17 @@ void Threads_AddActive(tThread *Thread) /** * \brief Removes the current thread from the active queue - * \warning This should ONLY be called with task switches disabled + * \warning This should ONLY be called with the lock held * \return Current thread pointer */ tThread *Threads_RemActive(void) { tThread *ret = Proc_GetCurThread(); - - SHORTLOCK( &glThreadListLock ); + + if( !IS_LOCKED(&glThreadListLock) ) { + Log_KernelPanic("Threads", "Threads_RemActive called without lock held"); + return NULL; + } // Delete from active queue #if SCHEDULER_TYPE == SCHED_RR_PRI @@ -938,8 +941,6 @@ tThread *Threads_RemActive(void) GetCPUNum(), ret, ret->TID, ret->ThreadName, giFreeTickets); #endif - SHORTREL( &glThreadListLock ); - return ret; }