]> rtime.felk.cvut.cz Git - frescor/fwp.git/commitdiff
revert the last change
authorMartin Molnar <molnam1@fel.cvut.cz>
Thu, 7 Feb 2008 23:31:54 +0000 (00:31 +0100)
committerMartin Molnar <molnam1@fel.cvut.cz>
Thu, 7 Feb 2008 23:31:54 +0000 (00:31 +0100)
fwp/libfwp/src/fwp_endpoint.c
fwp/libfwp/src/fwp_vres.c

index dce62bb5a348ccd031f20ac46ed77d2480825a80..2c1a14270676ddde86bce867162ec70ecdfe895c 100644 (file)
@@ -168,7 +168,7 @@ int fwp_send_endpoint_unbind(unsigned int epoint_id)
                return (-EPERM);
        }
        
-       fwp_vres_endpoint_unbind(vres_id, &fwp_endpoint_table[epoint_id]);
+       fwp_vres_endpoint_unbind(vres_id);
        epoint->vres = -1;
        epoint->status = FWP_EPOINT_UNBOUND;
 
index f211b28f0e98ede78356c205c49d9681ddb96efe..109ef359da52bf0a13937bfca29a886762c9858c 100644 (file)
@@ -26,8 +26,8 @@ typedef unsigned int  fwp_vresid_t;
 struct fwp_vres{
        struct fwp_contract contract;
        /* consideration: move tx_queue to endpoint */
-       struct fwp_msgq tx_queue;    /**< queue for messages to send */ 
-       struct fwp_endpoint *epoint; /**< endpoint bounded to this vres */ 
+       struct fwp_msgq tx_queue;       /**< queue for messages to send */ 
+       struct fwp_endpoint  *epoint;   /**< endpoint bounded to this vres */ 
        pthread_t tx_thread;
        pthread_attr_t tx_thread_attr;
        fwp_vres_status_t status;
@@ -109,7 +109,7 @@ int fwp_vres_close(unsigned int id)
        vres->status = FWP_VRES_CLOSING;
 
        /* unbind endpoint */
-       fwp_endpoint_unbind(vres->epoint);
+       vres->epoint->status = FWP_EPOINT_UNBOUND;
 
        pthread_cancel(vres->tx_thread);
 
@@ -201,14 +201,15 @@ static void* fwp_vres_tx_thread(void *_vres)
        return NULL;
 }
 
-inline void fwp_vres_endpoint_bind(unsigned int id, struct endpoint *epoint)
+inline void fwp_vres_endpoint_bind(unsigned int vres_id, 
+                                  struct fwp_endpoint *epoint)
 {
-       fwp_vres_table[id].epoint = epoint;
+       fwp_vres_table[vres_id].epoint = epoint;
 }
 
-inline void fwp_vres_endpoint_unbind(unsigned int id)
+inline void fwp_vres_endpoint_unbind(unsigned int vres_id)
 {
-       struct fwp_vres *vres = &fwp_vres_table[id];
+       struct fwp_vres *vres = &fwp_vres_table[vres_id];
        
        vres->epoint = NULL;
        /* TODO: consider what to do with pending messages */