iOS多线程之pThread

pThread是基于C语言开发的,移植性强,但是现在一般不常用。

简单使用:

    pthread_t pthread;
    pthread_create(&pthread, NULL, run, NULL);

    void *run(void *data) {
        for (int i = 0; i<= 10; i++) {
            NSLog(@"%d", i);
            sleep(1);
        }
        return NULL;
    }

你可能感兴趣的:(iOS多线程之pThread)