线程函数pthread_equal

#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>

int main(){
    pthread_t thread_id;

    thread_id=pthread_self(); // 返回调用线程的线程ID
    printf("Thread ID: %lu.\n",thread_id);

    if (pthread_equal(thread_id,pthread_self()))
     {
        printf("Equal!\n");
     } else {
        printf("Not equal!\n");
    }
    return 0;
}

你可能感兴趣的:(linux,线程函数,pthread_equal)