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

Function try_kill_one

src/engine/execnt.c:946–971  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

944
945
946static int try_kill_one()
947{
948 /* Only need to check if a timeout was specified with the -l option. */
949 if ( globs.timeout > 0 )
950 {
951 int i;
952 for ( i = 0; i < globs.jobs; ++i )
953 if ( cmdtab[ i ].pi.hProcess )
954 {
955 double const t = running_time( cmdtab[ i ].pi.hProcess );
956 if ( t > (double)globs.timeout )
957 {
958 /* The job may have left an alert dialog around, try and get
959 * rid of it before killing the job itself.
960 */
961 close_alert( &cmdtab[ i ].pi );
962 /* We have a "runaway" job, kill it. */
963 kill_process_tree( cmdtab[ i ].pi.dwProcessId,
964 cmdtab[ i ].pi.hProcess );
965 /* And return its running commands table slot. */
966 return i;
967 }
968 }
969 }
970 return -1;
971}
972
973
974static 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