关于编译器的一个疑问

         今天看了下@leekayak 说到的一个疑问 http://weibo.com/1465082730/znOSZzU4v        我试图用一个简略的例子来解说下,首先看一段更简略的代码。        #include "stdio.h"
#include "stdlib.h"
#include 

int f = 0;
int x=  0;

voi http://www.1111kp.info/linked/20130318.do d* t1(void*)
{
        while(f==0)
        {
                if(x!=0) printf("error");
        }
        return NULL;
};

void* t2(void*)
{
        x=1;
        f=1;
        return NULL;
};


int main(void)
{
         pthread_t* worker =  (pthread_t*) malloc(2*sizeof( pthread_t));
         pthread_create( http://www.fp1111.info/linked/20130318.do 
posted @ 2013-03-19 05:38  chinadiy197601  阅读(161)  评论(0编辑  收藏  举报