当前位置: 技术问答>linux和unix
(在线等)问个多线程交互操作的问题
来源: 互联网 发布时间:2016-10-13
本文导语: // process.cpp : Defines the entry point for the console application. // #include "pthread.h" #include #include #include #define MAX 10 pthread_t thread[2]; pthread_mutex_t mut; int number=0, i; void *thread1() { printf ("thread1 : I'm thread 1n"); for (i = 0;...
// process.cpp : Defines the entry point for the console application.
//
#include "pthread.h"
#include
#include
#include
#define MAX 10
pthread_t thread[2];
pthread_mutex_t mut;
int number=0, i;
void *thread1()
{
printf ("thread1 : I'm thread 1n");
for (i = 0; i