};
static int pending_threads = 0;
+int threads = 1;
static void data_process_string(Edje_Part_Collection *pc, const char *prefix, char *s, void (*func)(Edje_Part_Collection *pc, char *name, char* ptr, int len));
hw = calloc(1, sizeof(Head_Write));
hw->ef = ef;
pending_threads++;
- ecore_thread_run(data_thread_head, data_thread_head_end,
- NULL, hw);
+ if (threads)
+ ecore_thread_run(data_thread_head, data_thread_head_end, NULL, hw);
+ else
+ {
+ data_thread_head(hw, NULL);
+ data_thread_head_end(hw, NULL);
+ }
}
static void
if (!fc) continue;
fc->ef = ef;
fc->fn = fn;
- ecore_thread_run(data_thread_fonts, data_thread_fonts_end,
- NULL, fc);
+ pending_threads++;
+ if (threads)
+ ecore_thread_run(data_thread_fonts, data_thread_fonts_end, NULL, fc);
+ else
+ {
+ data_thread_fonts(fc, NULL);
+ data_thread_fonts_end(fc, NULL);
+ }
*font_num += 1;
}
eina_iterator_free(it);
evas_object_image_size_get(o, &iw->w, &iw->h);
iw->alpha = evas_object_image_alpha_get(o);
iw->data = evas_object_image_data_get(o, 0);
- ecore_thread_run(data_thread_image, data_thread_image_end, NULL, iw);
+ if (threads)
+ ecore_thread_run(data_thread_image, data_thread_image_end, NULL, iw);
+ else
+ {
+ data_thread_image(iw, NULL);
+ data_thread_image_end(iw, NULL);
+ }
}
static void
sw->i = i;
*sound_num += 1;
pending_threads++;
- ecore_thread_run(data_thread_sounds, data_thread_sounds_end,
- NULL, sw);
+ if (threads)
+ ecore_thread_run(data_thread_sounds, data_thread_sounds_end, NULL, sw);
+ else
+ {
+ data_thread_sounds(sw, NULL);
+ data_thread_sounds_end(sw, NULL);
+ }
}
}
}
gw->ef = ef;
gw->pc = pc;
pending_threads++;
- ecore_thread_run(data_thread_group, data_thread_group_end,
- NULL, gw);
+ if (threads)
+ ecore_thread_run(data_thread_group, data_thread_group_end, NULL, gw);
+ else
+ {
+ data_thread_group(gw, NULL);
+ data_thread_group_end(gw, NULL);
+ }
*collection_num += 1;
}
}
return ECORE_CALLBACK_CANCEL;
}
pending_threads++;
- ecore_thread_run(data_thread_script, data_thread_script_end,
- NULL, sc);
+ if (threads)
+ ecore_thread_run(data_thread_script, data_thread_script_end, NULL, sc);
+ else
+ {
+ data_thread_script(sc, NULL);
+ data_thread_script_end(sc, NULL);
+ }
return ECORE_CALLBACK_CANCEL;
}
sc->cd = cd;
sc->i = i;
pending_threads++;
- ecore_thread_run(data_thread_lua_script, data_thread_lua_script_end,
- NULL, sc);
+ if (threads)
+ ecore_thread_run(data_thread_lua_script, data_thread_lua_script_end, NULL, sc);
+ else
+ {
+ data_thread_lua_script(sc, NULL);
+ data_thread_lua_script_end(sc, NULL);
+ }
}
}
printf("lua scripts: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
}
pending_threads++;
- ecore_thread_run(data_thread_source, data_thread_source_end, NULL, ef);
+ if (threads)
+ ecore_thread_run(data_thread_source, data_thread_source_end, NULL, ef);
+ else
+ {
+ data_thread_source(ef, NULL);
+ data_thread_source_end(ef, NULL);
+ }
if (verbose)
{
printf("source: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
}
pending_threads++;
- ecore_thread_run(data_thread_fontmap, data_thread_fontmap_end, NULL, ef);
+ if (threads)
+ ecore_thread_run(data_thread_fontmap, data_thread_fontmap_end, NULL, ef);
+ else
+ {
+ data_thread_fontmap(ef, NULL);
+ data_thread_fontmap_end(ef, NULL);
+ }
if (verbose)
{
printf("fontmap: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
{
printf("sounds: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
}
-
- ecore_main_loop_begin();
+ if (pending_threads > 0) ecore_main_loop_begin();
+ // XXX: workaround ecore thread bug where it creates an internal worker
+ // thread task we don't know about and it is STILL active at this point
+ // and in the middle of shutting down, so if we get to exit the process
+ // it's still busy and will crash accessing stuff
+ while ((ecore_thread_active_get() + ecore_thread_pending_get()) > 0)
+ ecore_main_loop_iterate();
if (verbose)
{
printf("THREADS: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
}
-
+
eet_close(ef);
if (verbose)