I have problem with pass structure to thread function in SOLARIS.When I
pass it to created thread it always has empty values.
my structure defined as:
typedef struct momMSG{
struct mbhdr hd;
struct SCRIPTMSG MOMBuf;
}MY_SCRIPTMSG;
In my main function:
MY_SCRIPTMSG rcvVLMOMbuf;
--- fill rcvVLMOMbuf with values
if((rv = thr_create(NULL,0,ServerThread,(void *)
&rcvVLMOMbuf,THR_DETACHED, &tid)) == 0)
And in thread function:
void* ServerThread(void *arg)
{
MY_SCRIPTMSG* preceivedMSG = (MY_SCRIPTMSG*) arg;
}
The pointer preceivedMSG point on empty values.
What is the reason thanks