#include <Elementary.h>
#include <pthread.h>
struct info
{
double x, y;
};
static void my_thread_mainloop_code(void *data);
static pthread_t thread_id;
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));
(my_thread_mainloop_code, inf);
}
usleep(1000);
t += 0.02;
}
return NULL;
}
static void
my_thread_new(void)
{
pthread_attr_t attr;
if (pthread_attr_init(&attr) != 0)
perror("pthread_attr_init");
if (pthread_create(&thread_id, &attr, my_thread_run, NULL) != 0)
perror("pthread_create");
}
static void
my_thread_mainloop_code(void *data)
{
struct info *inf = data;
free(inf);
}
static void
{
}
EAPI_MAIN int
{
rect = o;
my_thread_new();
return 0;
}