]> rtime.felk.cvut.cz Git - frescor/forb.git/commitdiff
Object key is not the pointer but sequentially generated integer
authorMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 29 Sep 2008 14:58:59 +0000 (16:58 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 29 Sep 2008 14:58:59 +0000 (16:58 +0200)
With pointers it was too dangerous to send them across network. Moreover
it would be problematic if an object reference was released and a new one
would be malloced at the same place.

13 files changed:
Makefile.omk
forb-idl/forb-idl-c-headers.c
forb-idl/forb-idl-c-skels.c
forb-internal.h
forb.c
forb.h
iop.c
object.c [new file with mode: 0644]
object.h [new file with mode: 0644]
proto.c
request.c
tests/discovery.c
tests/hello_impl.c

index 023bcd7f456c295eed6ea7e3dd3a0c447993ea7e..ce6f153ca254bce44d1ddb92792c2ed4afb7cfa9 100644 (file)
@@ -7,7 +7,7 @@ IDL_COMPILER += --pidl
 
 lib_LIBRARIES += forb
 forb_SOURCES = forb.c cdr.c sha1.c uuid.c iop.c proto.c syncobj.c      \
-              request.c executor.c
+              request.c executor.c object.c
 forb_CLIENT_IDL = types.idl iop-idl.idl
 
 to_forb_subdir=$(1)->forb/$(strip $(1))
@@ -27,6 +27,7 @@ renamed_include_HEADERS += \
        $(call to_forb_subdir, syncobj.h) \
        $(call to_forb_subdir, request.h) \
        $(call to_forb_subdir, executor.h) \
+       $(call to_forb_subdir, object.h) \
        $(call to_forb_subdir, proto.h)
 
 renamed_include_GEN_HEADERS = \
index 75c08d6db12d136b6eebd66606e9b1d5caf40726..e81987c5b5df2ee9681e4f5ed43c699982b50879 100644 (file)
@@ -154,7 +154,8 @@ forb_idl_output_c_headers (IDL_tree tree, OIDL_Run_Info *rinfo, OIDL_C_Info *ci)
                    "#include <forb/basic_types.h>\n"
                    "\n");
   } else {
-    fprintf(ci->fh, "#include <forb/forb-internal.h>\n\n");
+    fprintf(ci->fh, "#include <forb/forb-internal.h>\n");
+    fprintf(ci->fh, "#include <forb/object.h>\n\n");
   }
 
   fprintf(ci->fh, "#ifdef __cplusplus\n");
index 9e935c4a607cc37d30047d61bde5adc4d0cf8737..df293f04433e51929604e67c751237de943e92bf 100644 (file)
@@ -401,10 +401,10 @@ cbe_skel_do_interface(IDL_tree tree, OIDL_Run_Info *rinfo, OIDL_C_Info *ci)
   fprintf(ci->fh, "  .type_hash = 0 /* not implemented */\n");
   fprintf(ci->fh, "};\n\n");
 
-  fprintf(ci->fh, "void forb_register_%s_interface(void)\n"
-                 "{\n"
-                 "  forb_register_interface(&%s_interface);\n"
-                 "}\n\n", id, id);
+/*   fprintf(ci->fh, "void forb_register_%s_interface(void)\n" */
+/*               "{\n" */
+/*               "  forb_register_interface(&%s_interface);\n" */
+/*               "}\n\n", id, id); */
 
   fprintf(ci->fh, "%s forb_%s_new(void *instance_data, "
                  "const struct forb_%s_impl *impl, forb_orb orb)\n"
index f804e8e54f1497cc7100c081c7f07005253ae302..8ea4ecc825b09ff2ae94e47d8e0ddf6583ee5fcc 100644 (file)
@@ -4,7 +4,6 @@
  * 
  * @brief  Declarationd necessary for IDL-generated code.
  * 
- * 
  */
 
 #ifndef FORB_INTERNAL_H
 #include <ul_gavlcust.h>
 #include <forb/forb.h>
 
-/** Object reference structure */
-struct forb_object {
-       /** @name Fields valid only for implementation */
-       /*@{*/
-
-       /** Any data for implementation (in server) */
-       void *instance_data;
-
-       /** Description of interface implemented by this object (for
-        * servers); FIXME: What about clients? */
-       const forb_interface_t *interface;
-
-       /** Pointer to the object implementation methods or NULL in
-        * case of remote object. */
-       const void *implementation;
-       /*@}*/
-       
-       /** Server implementing this object */
-       forb_server_id server;
-       /** Object key is just a pointer to the object in the
-        * implementation's address space. */
-       forb_object_key objkey;
-
-       forb_orb orb;           /**< FORB reference */
-};
-
-struct forb_interface {
-       char *name;
-       unsigned num_methods;
-       const forb_skel_func *skeletons;
-       uint32_t type_hash;
-};
 
 typedef struct forb_rt {
 } forb_rt;
@@ -61,9 +28,13 @@ typedef struct forb  forb_t;
 struct forb {
        forb_server_id server_id;
 
-       fosa_mutex_t id_mutex;  /**< Mutex for request_id */
+       fosa_mutex_t request_id_mutex;  /**< Mutex for request_id */
        CORBA_long request_id;  /**< Value of next sent request_id */
 
+       fosa_mutex_t objkey_mutex; /**< Mutex for objkey and objects */
+       forb_object_key objkey; /**< Objkey value of next created object  */
+       gavl_cust_root_field_t objects; /**< Tree of objects registered with this FORB. */
+
        //forb_rt rt;           /**< Routing table */
        //gavl_cust_root_field_t types;
 
@@ -77,17 +48,6 @@ struct forb {
        gavl_cust_root_field_t peers;
 };
 
-static inline forb_t *
-forb_data(forb_orb orb)
-{ return forb_instance_data(orb); }
-
-static inline forb_t *
-forb_obj_to_forb(forb_object obj)
-{ return forb_data(obj->orb); }
-
-forb_object_key forb_object_to_key(forb_object obj);
-forb_object forb_key_to_object(forb_object_key key);
-
 void
 forb_server_id_init(forb_server_id *serer);
 
@@ -102,5 +62,10 @@ forb_server_id_to_string(char *dest, const forb_server_id *server_id, size_t n)
        return forb_uuid_to_string(dest, (forb_uuid_t*)server_id->uuid, n);
 }
 
+static inline forb_server_id * 
+forb_server_id_from_string(forb_server_id *server_id, const char *string)
+{
+       return (forb_server_id *)forb_uuid_from_string((forb_uuid_t*)&server_id->uuid, string);
+}
 
 #endif
diff --git a/forb.c b/forb.c
index 6c953d9a222f02b8474f7854af97f6bbf15b04c0..e83b29e1725cd000ae4d5b02cc39abc729676be6 100644 (file)
--- a/forb.c
+++ b/forb.c
@@ -1,6 +1,7 @@
 #define _BSD_SOURCE            /* Because of on_exit()  */
 #include <stdlib.h>
 #include <forb/forb-internal.h>
+#include <forb/object.h>
 #include <forb/forb.h>
 #include <string.h>
 #include <ul_gavlcust.h>
@@ -42,7 +43,7 @@ forb_orb forb_init(void)
        
        object->instance_data = forb;
        forb_server_id_init(&forb->server_id);
-       if (fosa_mutex_init(&forb->id_mutex, 0) != 0) goto err2;
+       if (fosa_mutex_init(&forb->request_id_mutex, 0) != 0) goto err2;
        if (fosa_mutex_init(&forb->port_mutex, 0) != 0) goto err2;
        forb_port_init_head(forb);
        
@@ -52,6 +53,9 @@ forb_orb forb_init(void)
        if (fosa_mutex_init(&forb->peer_mutex, 0) != 0) goto err2;
        forb_peer_nolock_init_root_field(forb);
 
+       if (fosa_mutex_init(&forb->objkey_mutex, 0) != 0) goto err2;
+       forb_objects_nolock_init_root_field(forb);
+
 
 #ifdef CONFIG_FORB_PROTO_UNIX
        {
@@ -70,6 +74,9 @@ err1: forb_free(object);
 err:   return NULL;
 }
 
+/* FIXME: forb_destroy is now called automatically on exit. Therefore
+ * forb_destroy() should be either static or should deregister on_exit
+ * handler (how???).  */
 void forb_destroy(forb_orb orb)
 {
        forb_t *forb = orb->instance_data;
@@ -80,75 +87,14 @@ void forb_destroy(forb_orb orb)
                forb_destroy_port(port);
        }
        forb_free(forb);
-       forb_free(orb);
-}
-
-void
-forb_register_interface(const struct forb_interface *interface)
-{
-       //gavl_insert(&type_registry, &interface->node);
-}
-
-/** 
- * Creates a new object reference.
- * 
- * @param orb FORB pseudo object this object reference is handled by.
- * 
- * @param server_id Server ID of the FORB, where this object is
- * implemented or NULL if the object is implemented by @a orb.
- * 
- * @param key Key of the remote object or zero if the object is
- * implemented by @a orb.
- * 
- * @return FORB object reference of NULL in case of error.
- */
-forb_object
-forb_object_new(forb_orb orb,
-              forb_server_id *server_id,
-              forb_object_key key)
-{
-       forb_object obj = forb_malloc(sizeof(*obj));
-       if (obj) {
-               memset(obj, 0, sizeof(*obj));
-               obj->orb = orb;
-               if (key == 0) {
-#warning Rework objkeys to something different than address
-                       obj->objkey = (forb_object_key)(unsigned)obj;
-               } else {
-                       obj->objkey = key;
-               }
-               if (server_id) {
-                       obj->server = *server_id;
-               } else {
-                       if (orb) {
-                               obj->server = forb_obj_to_forb(obj)->server_id;
-                       }
-               }
-       }
-       return obj;
-}
-       
-/** 
- * Releases all memory associated with a object reference.
- * 
- * @param obj Object reference to release
- */
-void forb_object_release(forb_object obj)
-{
-       forb_free(obj);
+       forb_object_release(orb);
 }
 
-forb_object_key forb_object_to_key(forb_object obj)
-{
-       return obj->objkey;
-}
-
-forb_object forb_key_to_object(forb_object_key key)
-{
-       forb_object obj;
-       obj = (forb_object)(unsigned)key;
-       return obj;
-}
+/* void */
+/* forb_register_interface(const struct forb_interface *interface) */
+/* { */
+/*     gavl_insert(&type_registry, &interface->node); */
+/* } */
 
 void
 forb_server_id_init(forb_server_id *server_id)
@@ -156,72 +102,3 @@ forb_server_id_init(forb_server_id *server_id)
        forb_uuid_generate((forb_uuid_t*)server_id->uuid);
 }
 
-forb_server_id * 
-forb_server_id_from_string(forb_server_id *server_id, const char *string)
-{
-       return (forb_server_id *)forb_uuid_from_string((forb_uuid_t*)&server_id->uuid, string);
-}
-
-/** 
- * Converts object reference to string.
- * 
- * @param obj Object reference to convert.
- * 
- * @return String, which must be freed by forb_free() or NULL in case
- * of error.
- */
-char *
-forb_object_to_string(const forb_object obj)
-{
-       char *str;
-       size_t s;
-       forb_object_key key;
-       char server_id[65];
-       
-       s = 2*sizeof(forb_server_id)+1+2*sizeof(size_t)+1;
-       str = malloc(s);
-       if (!str) {
-               return NULL;
-       }
-
-       forb_server_id_to_string(server_id, &obj->server, s);
-       key = forb_object_to_key(obj);
-       snprintf(str, s, "%s-%llx", server_id, key);
-
-       return str;
-}
-
-/** 
- * Creates object reference from string.
- *
- * The string should be generated by forb_object_to_string() in the
- * same or another FORB. When the returned reference is not needed, it
- * should be freed by forb_object_release().
- * 
- * @param orb FORB which should handle the object.
- * @param string The string returned by forb_object_to_string().
- * 
- * @return FORB object reference or NULL in case of error.
- */
-forb_object
-forb_string_to_object(const forb_orb orb, const char *string)
-{
-       forb_object obj;
-       forb_object_key key;
-       forb_server_id server_id;
-       int ret;
-
-       if (forb_server_id_from_string(&server_id, string) == NULL)
-               return NULL;
-
-       if (string[2*sizeof(server_id)] != '-')
-               return NULL;
-
-       ret = sscanf(&string[2*sizeof(server_id)+1], "%llx", &key);
-       if (ret == 0 || ret == EOF)
-               return NULL;
-
-       obj = forb_object_new(orb, &server_id, key);
-       
-       return obj;
-}
diff --git a/forb.h b/forb.h
index c255ccddde4d189c453d624b693def62b6d3fc94..bd72035fa78d71f9baccd236350f8c0814acb6ac 100644 (file)
--- a/forb.h
+++ b/forb.h
@@ -78,8 +78,6 @@ typedef struct forb_interface forb_interface_t;
 
 struct forb_object;
 
-#define forb_instance_data(obj) ((obj)->instance_data)
-
 #define FORB_METHOD_INDEX(m) (m ## __method_index)
 
 
@@ -92,6 +90,8 @@ forb_orb forb_init(void);
 
 /** 
  * Deallocates all resources consumed by FORB.
+ *
+ * @note Called automatically on application exit.
  * 
  * @param orb FORB object reference to destroy.
  */
@@ -108,16 +108,13 @@ forb_object_new(forb_orb orb,
               forb_server_id *server_id,
               forb_object_key key);
 void
-forb_object_destroy(forb_object obj);
+forb_object_release(forb_object obj);
 
 void
-forb_register_reference(const char *id, forb_object object);
+forb_register_reference(const forb_orb orb, const char *id, forb_object object);
 
 forb_object
-forb_resolve_reference(const char *id);
-
-void
-forb_register_interface(const struct forb_interface *interface);
+forb_resolve_reference(const forb_orb orb, const char *id);
 
 forb_object
 forb_string_to_object(const forb_orb orb, const char *string);
diff --git a/iop.c b/iop.c
index ef0ca9fb24d87d139cb1b8277d200264ff208282..79650280f984c9de7c52f607d9438bd3281525fd 100644 (file)
--- a/iop.c
+++ b/iop.c
@@ -9,6 +9,7 @@
  */
 #include <forb/iop.h>
 #include <forb/cdr.h>
+#include <forb/object.h>
 
 /** Version of the protocol */
 #define VER_MAJOR 0
@@ -46,7 +47,7 @@ forb_iop_prepare_request(forb_request_t *req,
        rh.iface = iface;
        rh.objkey = forb_object_to_key(req->obj);
        rh.method_index = method_ind;
-       rh.source = forb_obj_to_forb(req->obj)->server_id;
+       rh.source = forb_object_to_forb(req->obj)->server_id;
        ret = forb_iop_request_header_serialize(&req->cdr_request, &rh);
        return ret;
 }
diff --git a/object.c b/object.c
new file mode 100644 (file)
index 0000000..e5654e4
--- /dev/null
+++ b/object.c
@@ -0,0 +1,144 @@
+#include <forb/forb-internal.h>
+#include <forb/object.h>
+#include <stdio.h>
+
+GAVL_CUST_NODE_INT_IMP(forb_objects_nolock /* cust_prefix */,
+                      forb_t /* cust_root_t */,
+                      struct forb_object /* cust_item_t */,
+                      forb_object_key /* cust_key_t */,
+                      objects /* cust_root_node */,
+                      node /* cust_item_node */,
+                      objkey /* cust_item_key */,
+                      forb_objkey_cmp/* cust_cmp_fnc */);
+
+/** 
+ * Creates a new object reference.
+ * 
+ * @param orb FORB pseudo object this object reference is handled
+ * by. This can be NULL only when forb_orb reference is created in
+ * forb_init().
+ * 
+ * @param server_id Server ID of the FORB, where this object is
+ * implemented or NULL if the object is implemented by @a orb.
+ * 
+ * @param key Key of the remote object. If server_id is NULL this
+ * value is ignored and new objkey is allocated.
+ * 
+ * @return FORB object reference of NULL in case of error.
+ */
+forb_object
+forb_object_new(forb_orb orb,
+              forb_server_id *server_id,
+              forb_object_key key)
+{
+       forb_object obj = forb_malloc(sizeof(*obj));
+       if (obj) {
+               memset(obj, 0, sizeof(*obj));
+               obj->orb = orb;
+               if (server_id) {
+                       obj->server = *server_id;
+                       obj->objkey = key;
+               } else {
+                       if (orb) {
+                               forb_t *forb = forb_object_to_forb(obj);
+                               obj->server = forb->server_id;
+                               fosa_mutex_lock(&forb->objkey_mutex);
+                               obj->objkey = ++forb->objkey;
+                               forb_objects_nolock_insert(forb, obj);
+                               fosa_mutex_unlock(&forb->objkey_mutex);
+                       }
+               }
+       }
+       return obj;
+}
+       
+/** 
+ * Releases all memory associated with a object reference and
+ * deregister the object from FORB.
+ * 
+ * @param obj Object reference to release
+ */
+void forb_object_release(forb_object obj)
+{
+       if (obj->orb) {
+               forb_t *forb = forb_object_to_forb(obj);
+               forb_objects_delete(forb, obj);
+       }
+       forb_free(obj);
+}
+
+forb_object_key forb_object_to_key(forb_object obj)
+{
+       return obj->objkey;
+}
+
+forb_object forb_key_to_object(forb_t *forb, forb_object_key key)
+{
+       forb_object obj;
+       obj = forb_objects_find(forb, key);
+       return obj;
+}
+
+/** 
+ * Converts object reference to string.
+ * 
+ * @param obj Object reference to convert.
+ * 
+ * @return String, which must be freed by forb_free() or NULL in case
+ * of error.
+ */
+char *
+forb_object_to_string(const forb_object obj)
+{
+       char *str;
+       size_t s;
+       forb_object_key key;
+       char server_id[65];
+       
+       s = 2*sizeof(forb_server_id)+1+2*sizeof(size_t)+1;
+       str = malloc(s);
+       if (!str) {
+               return NULL;
+       }
+
+       forb_server_id_to_string(server_id, &obj->server, s);
+       key = forb_object_to_key(obj);
+       snprintf(str, s, "%s-%llx", server_id, key);
+
+       return str;
+}
+
+/** 
+ * Creates object reference from string.
+ *
+ * The string should be generated by forb_object_to_string() in the
+ * same or another FORB. When the returned reference is not needed, it
+ * should be freed by forb_object_release().
+ * 
+ * @param orb FORB which should handle the object.
+ * @param string The string returned by forb_object_to_string().
+ * 
+ * @return FORB object reference or NULL in case of error.
+ */
+forb_object
+forb_string_to_object(const forb_orb orb, const char *string)
+{
+       forb_object obj;
+       forb_object_key key;
+       forb_server_id server_id;
+       int ret;
+
+       if (forb_server_id_from_string(&server_id, string) == NULL)
+               return NULL;
+
+       if (string[2*sizeof(server_id)] != '-')
+               return NULL;
+
+       ret = sscanf(&string[2*sizeof(server_id)+1], "%llx", &key);
+       if (ret == 0 || ret == EOF)
+               return NULL;
+
+       obj = forb_object_new(orb, &server_id, key);
+       
+       return obj;
+}
diff --git a/object.h b/object.h
new file mode 100644 (file)
index 0000000..9be342c
--- /dev/null
+++ b/object.h
@@ -0,0 +1,94 @@
+#ifndef FORB_OBJECT_H
+#define FORB_OBJECT_H
+
+#include <ul_gavlcust.h>
+#include <forb/forb-internal.h>
+
+/** Object reference structure */
+struct forb_object {
+       /** @name Fields valid only for implementation */
+       /*@{*/
+
+       /** Any data for implementation (in server) */
+       void *instance_data;
+
+       /** Description of interface implemented by this object (for
+        * servers); FIXME: What about clients? */
+       const forb_interface_t *interface;
+
+       /** Pointer to the object implementation methods or NULL in
+        * case of remote object. */
+       const void *implementation;
+
+       gavl_node_t node;       /**< Node for forb->objects tree */
+       /*@}*/
+       
+       /** Server implementing this object */
+       forb_server_id server;
+       /** Object key is just a pointer to the object in the
+        * implementation's address space. */
+       forb_object_key objkey;
+
+       forb_orb orb;           /**< FORB reference */
+};
+
+struct forb_interface {
+       char *name;
+       unsigned num_methods;
+       const forb_skel_func *skeletons;
+       uint32_t type_hash;
+};
+
+#define forb_object_instance_data(obj) ((obj)->instance_data)
+
+/** Return forb_t from an object reference. */
+static inline forb_t *
+forb_data(forb_orb orb)
+{ return forb_object_instance_data(orb); }
+
+
+static inline forb_t *
+forb_object_to_forb(forb_object obj)
+{ return forb_data(obj->orb); }
+
+forb_object_key forb_object_to_key(forb_object obj);
+forb_object forb_key_to_object(forb_t *forb, forb_object_key key);
+
+static inline int forb_objkey_cmp(forb_object_key *a, forb_object_key *b)
+{
+       return (*a<*b) ? -1 :
+               ((*a>*b) ? +1 :
+                0);
+}
+
+/* Declaration of typesafe function for storing objects in GAVL tree
+ * ordered by object keys. */
+GAVL_CUST_NODE_INT_DEC(forb_objects_nolock /* cust_prefix */,
+                      forb_t /* cust_root_t */,
+                      struct forb_object /* cust_item_t */,
+                      forb_object_key /* cust_key_t */,
+                      objects /* cust_root_node */,
+                      node /* cust_item_node */,
+                      objkey /* cust_item_key */,
+                      forb_objkey_cmp/* cust_cmp_fnc */);
+
+
+static inline void
+forb_objects_delete(forb_t *forb, forb_object obj)
+{
+       fosa_mutex_lock(&forb->objkey_mutex);
+       forb_objects_nolock_delete(forb, obj);
+       fosa_mutex_unlock(&forb->objkey_mutex);
+}
+
+static inline forb_object
+forb_objects_find(forb_t *forb, forb_object_key objkey)
+{
+       forb_object ret;
+       fosa_mutex_lock(&forb->objkey_mutex);
+       ret = forb_objects_nolock_find(forb, &objkey);
+       fosa_mutex_unlock(&forb->objkey_mutex);
+       return ret;
+}
+
+#endif
diff --git a/proto.c b/proto.c
index 59acae647790d690f2dd41a05511f6958194abe1..6dd5234b2a11e8a697200a2a97e883d48f294429 100644 (file)
--- a/proto.c
+++ b/proto.c
@@ -4,6 +4,7 @@
 #include <forb/config.h>
 #include <stdio.h>
 #include <ul_log.h>
+#include <forb/object.h>
 
 extern UL_LOG_CUST(ulogd_proto);
 
@@ -77,6 +78,7 @@ process_request(forb_port_t *port, CDR_Codec *codec)
        CORBA_boolean ret;
        forb_object obj;
        size_t n;
+       forb_t *forb = port->forb;
        struct forb_env env;
                
        CDR_codec_init_static(&reply_codec);    
@@ -96,7 +98,7 @@ process_request(forb_port_t *port, CDR_Codec *codec)
                goto out;
        } 
        
-       obj = forb_key_to_object(request_header.objkey);
+       obj = forb_key_to_object(forb, request_header.objkey);
        n = strlen(request_header.iface);
        if (strncmp(request_header.iface, obj->interface->name, n) != 0) {
                env.major = FORB_EX_INV_OBJREF;
@@ -445,7 +447,7 @@ forb_proto_send_request(forb_request_t *req, CORBA_Environment *env)
        CORBA_boolean ret;
        forb_peer_t *peer;
        size_t size;
-       forb_t *forb = forb_obj_to_forb(req->obj);
+       forb_t *forb = forb_object_to_forb(req->obj);
        if (!forb) {
                env->major = FORB_EX_INTERNAL;
                return;
index 8b641689e4d802efe7b80f70bff8d945568fa543..e97376259bc32c30754daa87c76989d6f010de69 100644 (file)
--- a/request.c
+++ b/request.c
@@ -1,6 +1,7 @@
 #include <forb/forb-internal.h>
 #include "request.h"
 #include <forb/iop-idl.h>
+#include <forb/object.h>
 
 static inline int forb_request_cmp(CORBA_unsigned_long *a, CORBA_unsigned_long *b)
 {
@@ -34,15 +35,15 @@ int
 forb_request_init(forb_request_t *req, forb_object obj)
 {
        int ret = 0;
-       forb_t *forb = forb_obj_to_forb(obj);
+       forb_t *forb = forb_object_to_forb(obj);
        CORBA_boolean bret;
 
        memset(req, 0, sizeof(*req));
        req->obj = obj;
 
-       fosa_mutex_lock(&forb->id_mutex);
+       fosa_mutex_lock(&forb->request_id_mutex);
        req->request_id = forb->request_id++;
-       fosa_mutex_unlock(&forb->id_mutex);
+       fosa_mutex_unlock(&forb->request_id_mutex);
 
        CDR_codec_init_static(&req->cdr_request);
        bret = CDR_buffer_init(&req->cdr_request, 256, forb_iop_MESSAGE_HEADER_SIZE);
index 81c80c36dab45add8c2618e42c06b83644471426..3772751f4aed30e79cbe97469fb097710824c287 100644 (file)
@@ -1,5 +1,6 @@
 #include <stdbool.h>
 #include <forb/forb.h>
+#include <forb/object.h>
 #include <forb/forb-internal.h>
 #include <forb/config.h>
 #include <unistd.h>
@@ -45,9 +46,5 @@ int main(int argc, char *argv[])
                }
        }
 
-       for (i=0; i<NUM_ORBS; i++) {
-               forb_destroy(orb[i]);
-       }
-
        return 0;
 }
index 53e9616ede31252bd14e114449b438bade08f096..06b8106f65ce04e6da53dd41406b6a434794ba46 100644 (file)
@@ -12,6 +12,5 @@ static const struct forb_hello_impl impl = {
 
 forb_object hello_impl_initialize(forb_orb orb)
 {
-       forb_register_hello_interface();
        return forb_hello_new(NULL, &impl, orb);
 }