Skip to content

Instantly share code, notes, and snippets.

@teamon
Created August 29, 2010 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save teamon/556517 to your computer and use it in GitHub Desktop.
Save teamon/556517 to your computer and use it in GitHub Desktop.
Animation(T * ptr):ptr(ptr){
printf("Animation()\n");
pthread_create(&thread, NULL, animation_thread_callback<T>, this);
};
~Animation(){
printf("~Animation()\n");
pthread_kill(thread, 0);
}
template <class T> void * animation_thread_callback(void * parent){
Animation<T> * anim = (Animation<T> * )parent;
while(true){
printf("animation_thread_callback()\n");
anim->step();
}
return NULL;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment