Link to home
Start Free TrialLog in
Avatar of mstrelan
mstrelanFlag for Australia

asked on

pass parameter to pthread_create

Probably too easy to Google but easier to just ask the experts :P

I have a call to pthread_create(&tid, &attr, workthread, NULL);

I want to be able to send a mixed array as the parameters... to be more precise I want to pass an int (sockfd) a string (message received on the socket).

How do I do this and how to I handle it in workthread?

Cheers guys
SOLUTION
Avatar of Infinity08
Infinity08
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mstrelan

ASKER

NOTE!!!! There is a semi colon missing after the struct declaration
struct my_args {
      int val1;
      float val2;
      char * val3;
}; // <--------------- added semicolon 

Open in new window