MCPcopy Create free account
hub / github.com/boostorg/build / try_kill_one

Function try_kill_one

v2/engine/execnt.c:815–840  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

813
814
815static int try_kill_one()
816{
817 /* Only need to check if a timeout was specified with the -l option. */
818 if ( globs.timeout > 0 )
819 {
820 int i;
821 for ( i = 0; i < globs.jobs; ++i )
822 if ( cmdtab[ i ].pi.hProcess )
823 {
824 double const t = running_time( cmdtab[ i ].pi.hProcess );
825 if ( t > (double)globs.timeout )
826 {
827 /* The job may have left an alert dialog around, try and get
828 * rid of it before killing the job itself.
829 */
830 close_alert( &cmdtab[ i ].pi );
831 /* We have a "runaway" job, kill it. */
832 kill_process_tree( cmdtab[ i ].pi.dwProcessId,
833 cmdtab[ i ].pi.hProcess );
834 /* And return its running commands table slot. */
835 return i;
836 }
837 }
838 }
839 return -1;
840}
841
842
843static void close_alerts()

Callers 1

exec_waitFunction · 0.85

Calls 3

running_timeFunction · 0.85
close_alertFunction · 0.85
kill_process_treeFunction · 0.85

Tested by

no test coverage detected