memset(&forb->attr, 0, sizeof(forb->attr));
}
+ sem_init(&forb->server_ready, 0, 0);
+
if (forb_server_id_empty(&forb->attr.fixed_server_id)) {
forb_server_id_init(&forb->server_id);
} else {
return NULL;
}
+ forb_executor_prepare();
+
orb = forb_forb_orb_new(NULL, &forb_implementation, forb);
if (!orb) goto err2;
/* Server ID must be assigned manualy */
* @param num_elements
* @param elem_size
*
- * @return CORBA_TRUE if the allocation was sucessfull, CORBA_FALSE if wasn't.
+ * @return CORBA_TRUE if the allocation was sucessfull, CORBA_FALSE if
+ * it wasn't.
*/
CORBA_boolean
__forb_sequence_alloc_buf_internal(void *seq, size_t seq_size,
forb_ul_log_fnc(ul_log_domain_t *domain, int level,
const char *format, va_list ap)
{
+ struct timespec now;
if(!(level&UL_LOGL_CONT)) {
level&=UL_LOGL_MASK;
+ clock_gettime(CLOCK_MONOTONIC, &now);
+ fprintf(forb_ul_log_file,"%ld.%6ld: ", now.tv_sec, now.tv_nsec/1000);
if (progname[0])
fprintf(forb_ul_log_file,"%s: ", progname);
if(domain && domain->name)
ul_log_redir(forb_ul_log_fnc, flg);
+ if((s = getenv("UL_LOG_LEVELS")) != NULL)
+ ul_log_domain_arg2levels(s);
+
return 0;
}
+
+/**
+ * Wait for the server to be ready. Internal function intended forb
+ * forbrun.
+ *
+ * @param orb ORB.
+ *
+ * @return Zero on success; on error -1 is returned, and errno is set
+ * to indicate the error.
+ */
+int forb_wait_for_server_ready(forb_orb orb)
+{
+ forb_t *forb = forb_object_to_forb(orb);
+ return sem_wait(&forb->server_ready);
+}
+
+/**
+ * Signal the the FORB core that the server is ready for accepting
+ * requests.
+ *
+ * This function should be called at the initialization of server
+ * implementation at the time when all objects are registered with
+ * executors. All other servers in the same address space are
+ * initialized after this function is called which allows the other
+ * servers to use the services provided by the calling server.
+ *
+ * @param orb ORB object.
+ *
+ * @return Zero on success; on error -1 is returned, and errno is set
+ * to indicate the error.
+ */
+int forb_signal_server_ready(forb_orb orb)
+{
+ forb_t *forb = forb_object_to_forb(orb);
+ return sem_post(&forb->server_ready);
+}