Ignore:
Timestamp:
06/01/11 17:26:12 (13 years ago)
Author:
mmamonski
Message:

sleep -> select

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pbs_drmaa/log_reader.c

    r18 r19  
    211211                                status.next = NULL; 
    212212 
    213                                 while ( sscanf(ptr, "%255[^;]%n", field, &n) == 1 ) /* divide current line into fields */ 
     213                                while ( sscanf(ptr, "%255[^;]%n", field, &n) == 1 ) /* split current line into fields */ 
    214214                                { 
    215215                                        if(field_n == FLD_DATE) 
     
    417417                                                         } 
    418418                                                        struct_state.value = fsd_strdup("C");   /* we got exit_status so we say that it has completed */ 
     419                                                        fsd_log_info(("WT - job %s found as finished on %u", self->name, (unsigned int)time(NULL))); 
    419420                                                }                                                
    420421                                                  
     
    499500                        if(self->job == NULL) 
    500501                        { 
     502                                struct timeval timeout_tv; 
     503                                fd_set log_fds; 
     504         
    501505                                fsd_mutex_unlock( &self->session->mutex );                       
    502                                 usleep(1000000); 
     506                                 
     507                                FD_ZERO(&log_fds); 
     508                                FD_SET(self->fd, &log_fds); 
     509 
     510                                timeout_tv.tv_sec = 1; 
     511                                timeout_tv.tv_usec = 0; 
     512 
     513                                /* ignore return value - the next get line call will handle IO errors */ 
     514                                (void)select(1, &log_fds, NULL, NULL, &timeout_tv); 
     515 
    503516                                fsd_mutex_lock( &self->session->mutex );         
    504                         } 
    505                          
    506                         if(self->job == NULL) 
    507                         { 
     517 
    508518                                self->run_flag = self->session->wait_thread_run_flag; 
    509519                        } 
Note: See TracChangeset for help on using the changeset viewer.