?
=?ISO-8859-1?Q?Andreas_M=FCller?=
i have a problem with threads and casts,
I created a thread
pthread_create(&grab_thread, NULL, grab_image, (void*)&camera);
and my function is like this:
void *grab_image(void *camera)
{..}
originally the type of camera is "struct Camera" but pthreads only wants
voids. now I need to cast the "void *camera" to "struct Camera *camera"
in the functions body. but how? or is the pthread_create wrong?
I created a thread
pthread_create(&grab_thread, NULL, grab_image, (void*)&camera);
and my function is like this:
void *grab_image(void *camera)
{..}
originally the type of camera is "struct Camera" but pthreads only wants
voids. now I need to cast the "void *camera" to "struct Camera *camera"
in the functions body. but how? or is the pthread_create wrong?