OK, i can see, i have to give a better picture.
For the sake of simplicity i made a real tiny example.
Here is what is closer to the real one:
Code:
main() {
     myent=ent_create(...);
     myent.event=whatever;
}

void whatever() {
  while(1) {
     myfunc();
     wait_for(myfunc);
     wait(1);
  }
}

void myfunc() {
  do some writes into the file
}