pthread_mutex_lock互斥鎖的使用

直接上個例子幾簡單哦! 現在我姑且認爲互斥鎖就是爲了保護共享變量(現在看到的這個共享變量就是全局變量)而設置的,因爲還沒學那麼多。 //互斥鎖的使用 #include<errno.h> #include< cstring> #include< iostream> #include< cstdlib> #include<sys/socket.h> #include<sys/types.h> #inc
相關文章
相關標籤/搜索