首页
Python
Java
前端
数据库
Linux
Chatgpt专题
开发者工具箱
chap30专题
《OSTEP》条件变量(chap30)
〇、前言 本文是对《OSTEP》第三十章的实践与总结。 一、条件变量 #include <pthread.h>#include <stdio.h>#include <assert.h>int buffer;int count = 0; // 资源为空// 生产,在 buffer 中放入一个值void put(int value) {assert(count == 0);count =
阅读更多...