fosa_mutex_lock(&executor->mutex);
while (1) {
- fosa_cond_wait(&executor->new_request_in_empty_list,
- &executor->mutex);
while (!forb_exec_req_nolock_is_empty(executor)) {
forb_exec_req_t *exec_req;
exec_req = forb_exec_req_nolock_cut_first(executor);
fosa_mutex_lock(&executor->mutex);
}
+ fosa_cond_wait(&executor->new_request_in_empty_list,
+ &executor->mutex);
}
fosa_mutex_unlock(&executor->mutex);
ret:
/**
* Convenience function for executing only one object in one executor.
+ * This function calls forb_signal_server_ready() at the appropriate
+ * place.
*
* @param obj The object to execute.
*
if (ret) goto error;
ret = forb_executor_register_object(&executor, obj);
if (ret) goto destroy_and_error;
+
+ ret = forb_signal_server_ready(obj->orb);
+ if (ret) goto destroy_and_error;
ret = forb_executor_run(&executor);
/**
* Determines the executor we are currently in.
*
- * @param executor Current executor pointer.
- *
- * @return Zero in case of success.
+ * @return Pointer to the current executor or NULL if not called
+ * within executor.
*/
-int forb_get_current_executor(forb_executor_t **executor)
+forb_executor_t *forb_get_current_executor(void)
{
- int ret = 0;
- *executor = (void *) pthread_getspecific(forb_executor_key);
-
- if (!(*executor))
- ret = 1;
- return ret;
+ return pthread_getspecific(forb_executor_key);
}