线程传参数

/*
typedef struct 
{
    int m_pos;
    char *m_file;
}my_adt;
*/
struct my_adt
{
    int m_pos;
    char *m_file;
};

=====================================

小姑娘  搞事情

======================================================

/*
    my_adt adt;
    adt.m_file=m_executefile;
    adt.m_pos = m_executepos;
    */
    struct my_adt *b;
    b = (struct my_adt *)malloc(sizeof(struct my_adt));
    b->m_file=const_cast<char*>(m_executefile.c_str());
    b->m_pos = m_executepos;
   // int err = pthread_create(&pt,  &attr, threadFun, (void*)&m_args);
   // int err = pthread_create(&pt,  &attr, threadFun, (void*)&adt);
    int err = pthread_create(&pt,  &attr, threadFun, (void*)b);

猜你喜欢

转载自blog.csdn.net/lusic01/article/details/82876336