/[monit]/monit/validate.c
ViewVC logotype

Diff of /monit/validate.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.57 by hauk, Wed Jul 30 01:27:15 2003 UTC revision 1.58 by hauk, Thu Jul 31 00:47:18 2003 UTC
# Line 115  void validate() { Line 115  void validate() {
115      log("Update of loadavg has failed!\n");      log("Update of loadavg has failed!\n");
116            
117    }    }
118      
119    for(s= servicelist; s; s= s->next) {    for(s= servicelist; s; s= s->next) {
120      if(s->visited)      if(s->visited)
121          continue;          continue;
122      do_validate(s, pt, treesize);      LOCK(s->mutex)
123            do_validate(s, pt, treesize);
124        END_LOCK;
125    }    }
126    
127    reset_depend();    reset_depend();
# Line 151  static void do_validate(Service_T s, Pro Line 153  static void do_validate(Service_T s, Pro
153    ASSERT(s);    ASSERT(s);
154    ASSERT(s->path);    ASSERT(s->path);
155        
   /* Obtain service action mutex */  
   LOCK(s->mutex)  
   
156    /* First, check for pre-conditions */    /* First, check for pre-conditions */
157    if(do_not_validate(s)) {    if(do_not_validate(s)) {
     /* Release service action mutex */  
     pthread_mutex_unlock(&s->mutex);  
158      return;      return;
159    }    }
160        
# Line 205  static void do_validate(Service_T s, Pro Line 202  static void do_validate(Service_T s, Pro
202    }    }
203    
204    /** Common task actions */    /** Common task actions */
205    if (! check_timestamps(s))    if(! check_timestamps(s))
206      goto reinstall;      goto reinstall;
   
207                
208    reinstall:    reinstall:
209        
210    /* Remove the SIGTERM block */    /* Remove the SIGTERM block */
211    pthread_sigmask(SIG_SETMASK, &os, NULL);    pthread_sigmask(SIG_SETMASK, &os, NULL);
   
   /* Release service action mutex */  
   END_LOCK;  
212    
213  }  }
214    

Legend:
Removed from v.1.57  
changed lines
  Added in v.1.58

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26