天天看點

Linux多線程函數的參數問題

場景說明

    有些系統對于pthread_create中需要指定的線程函數的參數并不執行嚴格的檢查,但是有些會出現編譯錯誤,是以需要進行如下的修改

 void *thread1()

 if((temp = pthread_create(&thread[0], NULL, thread1, NULL)) != 0)  

提示:invalid conversion from 'void* (*)()' to 'void* (*)(void*)'

=============

改成: void *thread1(void *)

http://blog.sina.com.cn/s/blog_698f90230100xxfn.html

http://blog.csdn.net/do2jiang/article/details/5527155

     本文轉自fengyuzaitu 51CTO部落格,原文連結:http://blog.51cto.com/fengyuzaitu/1598935,如需轉載請自行聯系原作者

繼續閱讀