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

Function try_wait

src/engine/execnt.cpp:879–912  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

877 */
878
879static int32_t try_wait( int32_t const timeoutMillis )
880{
881 if ( globs.jobs <= MAXIMUM_WAIT_OBJECTS )
882 {
883 int32_t i;
884 HANDLE active_handles[ MAXIMUM_WAIT_OBJECTS ];
885 int32_t job_ids[ MAXIMUM_WAIT_OBJECTS ];
886 DWORD num_handles = 0;
887 DWORD wait_api_result;
888 for ( i = 0; i < globs.jobs; ++i )
889 {
890 if( cmdtab[ i ].pi.hProcess )
891 {
892 job_ids[ num_handles ] = i;
893 active_handles[ num_handles ] = cmdtab[ i ].pi.hProcess;
894 ++num_handles;
895 }
896 }
897 wait_api_result = WaitForMultipleObjects( num_handles, active_handles, FALSE, timeoutMillis );
898 if ( WAIT_OBJECT_0 <= wait_api_result && wait_api_result < WAIT_OBJECT_0 + globs.jobs )
899 {
900 return job_ids[ wait_api_result - WAIT_OBJECT_0 ];
901 }
902 else
903 {
904 return -1;
905 }
906 }
907 else
908 {
909 return try_wait_impl( timeoutMillis );
910 }
911
912}
913
914
915static int32_t try_kill_one()

Callers 1

exec_waitFunction · 0.85

Calls 1

try_wait_implFunction · 0.85

Tested by

no test coverage detected