Changeset 2085 for Whitix/branches/netchannel/kernel/thread.c
- Timestamp:
- 05/20/10 16:05:25 (2 years ago)
- Files:
-
- 1 modified
-
Whitix/branches/netchannel/kernel/thread.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Whitix/branches/netchannel/kernel/thread.c
r1677 r2085 142 142 143 143 if (thread == currThread) 144 ArchSwitchStackCall(exitStack +PAGE_SIZE/4,_ThrFreeThread,thread);144 ArchSwitchStackCall(exitStack + (PAGE_SIZE >> 2),_ThrFreeThread,thread); 145 145 else{ 146 146 MemFree((void*)(thread->currStack)); … … 233 233 ***********************************************************************/ 234 234 235 void Thr SuspendThread(struct Thread* thread)235 void ThrDoSuspendThread(struct Thread* thread, int state) 236 236 { 237 237 if (thread == idleTask) 238 238 KernelPanic("Idle task being suspended - driver sleeping in interrupt?"); 239 239 240 SpinLockIrq(&thrListLock); 241 240 242 if (LIKELY(thread->state == THR_RUNNING)) 241 243 { 242 SpinLockIrq(&thrListLock);243 244 --nrRunning; 244 thread->state=THR_PAUSED; 245 SpinUnlockIrq(&thrListLock); 246 } 245 thread->state = state; 246 } 247 248 SpinUnlockIrq(&thrListLock); 249 } 250 251 void ThrSuspendThread(struct Thread* thread) 252 { 253 ThrDoSuspendThread(thread, THR_PAUSED); 247 254 } 248 255 249 256 SYMBOL_EXPORT(ThrSuspendThread); 250 257 258 void ThrSuspendThreadInt(struct Thread* thread) 259 { 260 ThrDoSuspendThread(thread, THR_INTERRUPTIBLE); 261 } 262 263 SYMBOL_EXPORT(ThrSuspendThreadInt); 264 251 265 /*********************************************************************** 252 266 * 253 267 * FUNCTION: ThrResumeThread 254 268 * 255 * DESCRIPTION: Resume a paused thread, and signal scheduling if it's of 256 * a higher priority. 269 * DESCRIPTION: Resume a paused thread. 257 270 * 258 271 * PARAMETERS: thread - the thread in question. … … 268 281 ThrStartThread(thread); 269 282 if (thread->quantums >= currThread->quantums) 270 thrNeedSchedule =true;283 thrNeedSchedule = true; 271 284 } 272 285 }
