This is the same as EFL Threading example 4 but now uses the ecore_thread infrastructure to have a running worker thread that feeds results back to the mainloop and can easily be cancelled.
This saves some code in the application and makes for fewer problem spots if you forget a mutex.
EFL Threading example 6
#include <Elementary.h>
struct info
{
double x, y;
};
static void
{
double t = 0.0;
for (;;)
{
struct info *inf = malloc(sizeof(struct info));
if (inf)
{
inf->x = 200 + (200 * sin(t));
inf->y = 200 + (200 * cos(t));
}
usleep(1000);
t += 0.02;
}
}
static void
{
struct info *inf = msg;
free(inf);
}
static void
{
thr = NULL;
}
static void
{
thr = NULL;
}
EAPI_MAIN int
{
rect = o;
return 0;
}