THREAD.C program Pthread_create function The third parameter is the starting address of the thread function, there is no add function, the source code is as follows:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/57/76/wKiom1SaiH_BoPKlAADUU3OTYJ8972.jpg "title=" 2014-12-24 16:56:36 screen. png "alt=" wkiom1saih_bopklaaduu3otyj8972.jpg "/>
THREAD.C will report an undeclared error at compile time:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/57/76/wKiom1SajCTCUDHBAAE0_xQ4Rqs094.jpg "title=" 2014-12-24 17:49:04 screen. png "alt=" wkiom1sajctcudhbaae0_xq4rqs094.jpg "/>
Based on the context, it should be count, replaced by the following:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/57/76/wKiom1SajYLBhAM4AADBIuTlF24768.jpg "title=" 2014-12-24 17:55:00 screen. png "alt=" wkiom1sajylbham4aadbiutlf24768.jpg "/>
Recompile, GCC compile at the last add parameter-lpthread, otherwise the compiler
Pthread_create and pthread_join non-defined references as follows:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/57/76/wKiom1SajP6DI8G3AAFTRGH58Ps468.jpg "title=" 2014-12-24 17:52:50 screen. png "alt=" wkiom1sajp6di8g3aaftrgh58ps468.jpg "/>
Should be at the end of the line to add-lpthread compile, compile the command correctly:
Gcc-lpthread Thread.c-o Main
The THREAD.GO program has no z variables and should be counter:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/57/74/wKioL1SalIbhm5-iAABZir4h82A627.jpg "title=" 2014-12-24 18:20:22 screen. png "alt=" wkiol1salibhm5-iaabzir4h82a627.jpg "/>
This article is from the "Pine" blog, be sure to keep this source http://dongsong.blog.51cto.com/916653/1595611
"Go language Programming" [4.4 Concurrent Communication] Code THREAD.C and Thread.go error