- 论坛徽章:
- 0
|
int test()
{
char szSendBuf[1024];
pthread_t pid;
memset(szSendBuf, 0, sizeof(szSendBuf));
SCSetMTStr("138", "138", "hello", "1015788", 6, szSendBuf); //附值给szSendBuf
pthread_create(&pid, NULL, SCConnect, szSendBuf);
//pthread_join(pthread_self(), NULL);
}
void SCConnect(const char *pParam)
{
//pthread_detach(pthread_self());
sgip_get_message_head(&pHead, (char *)pParam);
printf("head:%u\n", pHead.nCommandId);
....
}
如上面程序,当到SCConnect函数printf处,打印出来的数据并非我想要的,也就是说数据没有传递到SCConnect函数,我在test函数最后加了sleep(1)就没问题,但我目前不想要sleep,怎么解决!(传送字符串) |
|