extern UL_LOG_CUST(ulogd_forb_executor);
-int forb_executor_key = -1;
+static int forb_executor_key = -1;
+
+int forb_executor_prepare()
+{
+ return fosa_key_create(&forb_executor_key);
+}
/**
* Initializes executor.
int forb_executor_run(forb_executor_t *executor)
{
int ret;
- // for thread specific data testing
-#ifdef DEBUG_EXECUTOR
- forb_executor_t *executor_test;
-#endif
-
- // initializing thread specific data (FIXME: maybe should be somewhere else)
- if (forb_executor_key == -1) {
- if ((ret = fosa_key_create(&forb_executor_key)))
- goto ret;
- }
+
// setting pointer to executor as thread specific data
if ((ret = fosa_thread_set_specific_data(forb_executor_key,
- fosa_thread_self(), executor)))
+ fosa_thread_self(), executor)))
goto ret;
-
-#ifdef DEBUG_EXECUTOR
- printf("Executor: current executor saved: %p\n", executor);
- forb_get_current_executor(&executor_test);
- printf("Executor: current executor loaded: %p\n", executor_test);
-#endif
-
+
fosa_mutex_lock(&executor->mutex);
while (1) {
fosa_cond_wait(&executor->new_request_in_empty_list,