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

Function try_kill_one

src/engine/execnt.cpp:915–940  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

913
914
915static int32_t try_kill_one()
916{
917 /* Only need to check if a timeout was specified with the -l option. */
918 if ( globs.timeout > 0 )
919 {
920 int32_t i;
921 for ( i = 0; i < globs.jobs; ++i )
922 if ( cmdtab[ i ].pi.hProcess )
923 {
924 double const t = running_time( cmdtab[ i ].pi.hProcess );
925 if ( t > (double)globs.timeout )
926 {
927 /* The job may have left an alert dialog around, try and get
928 * rid of it before killing the job itself.
929 */
930 close_alert( &cmdtab[ i ].pi );
931 /* We have a "runaway" job, kill it. */
932 kill_process_tree( cmdtab[ i ].pi.dwProcessId,
933 cmdtab[ i ].pi.hProcess );
934 /* And return its running commands table slot. */
935 return i;
936 }
937 }
938 }
939 return -1;
940}
941
942
943static 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