Diff for /libaitrpc/src/lists.c between versions 1.8 and 1.9

version 1.8, 2012/03/29 01:34:16 version 1.9, 2012/05/14 08:39:06
Line 136  rpc_srv_registerCall(rpc_srv_t * __restrict srv, const Line 136  rpc_srv_registerCall(rpc_srv_t * __restrict srv, const
         }          }
   
         /* add to list of functions */          /* add to list of functions */
         pthread_mutex_lock(&srv->srv_mtx);  
         func->func_next = srv->srv_funcs;          func->func_next = srv->srv_funcs;
         srv->srv_funcs = func;          srv->srv_funcs = func;
         pthread_mutex_unlock(&srv->srv_mtx);  
         return 0;          return 0;
 }  }
   
Line 166  rpc_srv_unregisterCall(rpc_srv_t * __restrict srv, con Line 164  rpc_srv_unregisterCall(rpc_srv_t * __restrict srv, con
         if (rpc_calcHashes(&func, csModule, csFunc) == -1)          if (rpc_calcHashes(&func, csModule, csFunc) == -1)
                 return -1;                  return -1;
   
         pthread_mutex_lock(&srv->srv_mtx);  
         f = rpc_srv_getCall(srv, func.func_tag, func.func_hash);          f = rpc_srv_getCall(srv, func.func_tag, func.func_hash);
         AIT_FREE_VAL(&func.func_name);          AIT_FREE_VAL(&func.func_name);
         AIT_FREE_VAL(&func.func_file);          AIT_FREE_VAL(&func.func_file);
        if (!f) {                       /* not found element for unregister */        if (!f)                 /* not found element for unregister */
                pthread_mutex_unlock(&srv->srv_mtx); 
                 return 0;                  return 0;
         }  
   
         /* remove from list of functions */          /* remove from list of functions */
         if (srv->srv_funcs == f)        /* if is 1st element */          if (srv->srv_funcs == f)        /* if is 1st element */
Line 186  rpc_srv_unregisterCall(rpc_srv_t * __restrict srv, con Line 181  rpc_srv_unregisterCall(rpc_srv_t * __restrict srv, con
         AIT_FREE_VAL(&f->func_name);          AIT_FREE_VAL(&f->func_name);
         AIT_FREE_VAL(&f->func_file);          AIT_FREE_VAL(&f->func_file);
         free(f);          free(f);
         pthread_mutex_unlock(&srv->srv_mtx);  
   
         return 1;          return 1;
 }  }
Line 292  rpc_srv_registerBLOB(rpc_srv_t * __restrict srv, size_ Line 286  rpc_srv_registerBLOB(rpc_srv_t * __restrict srv, size_
   
         blob = rpc_srv_blobCreate(srv, len);          blob = rpc_srv_blobCreate(srv, len);
         if (blob) {          if (blob) {
                 pthread_mutex_lock(&srv->srv_blob.mtx);  
                 blob->blob_next = srv->srv_blob.blobs;                  blob->blob_next = srv->srv_blob.blobs;
                 srv->srv_blob.blobs = blob;                  srv->srv_blob.blobs = blob;
                 pthread_mutex_unlock(&srv->srv_blob.mtx);  
         }          }
   
         return blob;          return blob;
Line 325  rpc_srv_unregisterBLOB(rpc_srv_t * __restrict srv, uin Line 317  rpc_srv_unregisterBLOB(rpc_srv_t * __restrict srv, uin
         if (b->blob_data)          if (b->blob_data)
                 rpc_srv_blobUnmap(b);                  rpc_srv_blobUnmap(b);
   
         pthread_mutex_lock(&srv->srv_blob.mtx);  
         if (srv->srv_blob.blobs == b) { /* if is 1st element */          if (srv->srv_blob.blobs == b) { /* if is 1st element */
                 srv->srv_blob.blobs = srv->srv_blob.blobs->blob_next;                  srv->srv_blob.blobs = srv->srv_blob.blobs->blob_next;
         } else {          } else {
                 for (curr = srv->srv_blob.blobs; curr->blob_next != b; curr = curr->blob_next);                  for (curr = srv->srv_blob.blobs; curr->blob_next != b; curr = curr->blob_next);
                 curr->blob_next = curr->blob_next->blob_next;                  curr->blob_next = curr->blob_next->blob_next;
         }          }
         pthread_mutex_unlock(&srv->srv_blob.mtx);  
         rpc_srv_blobFree(srv, b);          rpc_srv_blobFree(srv, b);
         free(b);          free(b);
   

Removed from v.1.8  
changed lines
  Added in v.1.9


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>