34 void *(*user_func)(
void *);
66 pthread_exit(return_value);
86 int main(
int argc,
char *argv[])
96 string arg(
"string from main");
106 params.
other_info = (
void *)
"literal string in main params";
110 pthread_create(&tid, (pthread_attr_t *)NULL,
func, (
void *)¶ms);
113 pthread_join(tid, ret);
121 cout << *((
string *)(
string *)*ret) << endl;
124 delete ((
string *)(
string *)*ret);
152 cout << *(
string *)arg << endl;
155 string *s =
new string(
"string from myfunc");
158 cout <<
"myfunc returning:" << *s <<endl;
void * func(void *arg)
A wrapper function for the user defined function.
wrapper function parameters/arguments
void *(* user_func)(void *)
int main(int argc, char *argv[])
void * myfunc(void *arg)
user defined function