使用C ++中的类方法调用pthread_create()

时间:2014-11-26 23:29:30

标签: c++ pthreads

我无法在windows下的pthread_create中调用类方法。 我有类Client包含2个方法method_called和method_call_thread

class Client
{
public:
    int i;
    pthread_t t1;

    Client()
    {
        cout<<"mon constructeur";
    }

    void method_called(int i)
    {
        // code method
    }

    void method_call_thread(int x)
    {
        pthread_create(&t1,NULL,method_called,(void*)x);
    }
};

0 个答案:

没有答案