MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / KillThread

Method KillThread

neo/game/script/Script_Thread.cpp:604–627  ·  view source on GitHub ↗

================ idThread::KillThread ================ */

Source from the content-addressed store, hash-verified

602================
603*/
604void idThread::KillThread( const char *name ) {
605 int i;
606 int num;
607 int len;
608 const char *ptr;
609 idThread *thread;
610
611 // see if the name uses a wild card
612 ptr = strchr( name, '*' );
613 if ( ptr ) {
614 len = ptr - name;
615 } else {
616 len = strlen( name );
617 }
618
619 // kill only those threads whose name matches name
620 num = threadList.Num();
621 for( i = 0; i < num; i++ ) {
622 thread = threadList[ i ];
623 if ( !idStr::Cmpn( thread->GetThreadName(), name, len ) ) {
624 thread->End();
625 }
626 }
627}
628
629/*
630================

Callers

nothing calls this directly

Calls 3

NumMethod · 0.45
GetThreadNameMethod · 0.45
EndMethod · 0.45

Tested by

no test coverage detected