svghmi/svghmi.c
branchsvghmi
changeset 2819 3b99c908f43b
parent 2817 45bbfb2e120f
child 2820 d9b5303d43dc
equal deleted inserted replaced
2818:65f32c94d7ec 2819:3b99c908f43b
   196 
   196 
   197 int __init_svghmi()
   197 int __init_svghmi()
   198 {
   198 {
   199     bzero(rbuf,sizeof(rbuf));
   199     bzero(rbuf,sizeof(rbuf));
   200     bzero(wbuf,sizeof(wbuf));
   200     bzero(wbuf,sizeof(wbuf));
       
   201 
       
   202     pthread_mutex_lock(&svghmi_send_WakeCondLock);
   201     continue_collect = 1;
   203     continue_collect = 1;
       
   204     pthread_cond_signal(&svghmi_send_WakeCond);
       
   205     pthread_mutex_unlock(&svghmi_send_WakeCondLock);
   202 
   206 
   203     return 0;
   207     return 0;
   204 }
   208 }
   205 
   209 
   206 void __cleanup_svghmi()
   210 void __cleanup_svghmi()
   228 /* PYTHON CALLS */
   232 /* PYTHON CALLS */
   229 int svghmi_send_collect(uint32_t *size, char **ptr){
   233 int svghmi_send_collect(uint32_t *size, char **ptr){
   230 
   234 
   231     int do_collect;
   235     int do_collect;
   232     pthread_mutex_lock(&svghmi_send_WakeCondLock);
   236     pthread_mutex_lock(&svghmi_send_WakeCondLock);
       
   237     pthread_cond_wait(&svghmi_send_WakeCond, &svghmi_send_WakeCondLock);
   233     do_collect = continue_collect;
   238     do_collect = continue_collect;
   234     if(do_collect)
       
   235     {
       
   236         pthread_cond_wait(&svghmi_send_WakeCond, &svghmi_send_WakeCondLock);
       
   237         do_collect = continue_collect;
       
   238     }
       
   239     pthread_mutex_unlock(&svghmi_send_WakeCondLock);
   239     pthread_mutex_unlock(&svghmi_send_WakeCondLock);
   240 
   240 
   241     if(do_collect) {
   241     if(do_collect) {
   242         int res;
   242         int res;
   243         sbufidx = HMI_HASH_SIZE;
   243         sbufidx = HMI_HASH_SIZE;