| 849 | } |
| 850 | |
| 851 | static int32_t try_wait_impl( DWORD timeout ) |
| 852 | { |
| 853 | int32_t job_index; |
| 854 | int32_t res = WaitForSingleObject( process_queue.read_okay, timeout ); |
| 855 | if ( res != WAIT_OBJECT_0 ) |
| 856 | return -1; |
| 857 | job_index = process_queue.job_index; |
| 858 | SetEvent( process_queue.write_okay ); |
| 859 | return job_index; |
| 860 | } |
| 861 | |
| 862 | static void register_wait( int32_t job_id ) |
| 863 | { |