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

Method KillThread

neo/d3xp/script/Script_Thread.cpp:626–649  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

624================
625*/
626void idThread::KillThread( const char *name ) {
627 int i;
628 int num;
629 int len;
630 const char *ptr;
631 idThread *thread;
632
633 // see if the name uses a wild card
634 ptr = strchr( name, '*' );
635 if ( ptr ) {
636 len = ptr - name;
637 } else {
638 len = strlen( name );
639 }
640
641 // kill only those threads whose name matches name
642 num = threadList.Num();
643 for( i = 0; i < num; i++ ) {
644 thread = threadList[ i ];
645 if ( !idStr::Cmpn( thread->GetThreadName(), name, len ) ) {
646 thread->End();
647 }
648 }
649}
650
651/*
652================

Callers

nothing calls this directly

Calls 3

NumMethod · 0.45
GetThreadNameMethod · 0.45
EndMethod · 0.45

Tested by

no test coverage detected