📄 produce.c
字号:
#define __THREADS_MAIN#include <thread.h>#include <string>#include <iostream>extern "C" {# include <unistd.h>};using namespace std;using namespace cpp_threads;main(){ Cond t_control(attributes::process_shared_e); Mutex t_link(attributes::process_shared_e); char *buf = (char *)Pthread::shalloc(80); t_link.lock(); cout << "Enter text for consumer: "; cout.flush(); cin.getline(buf,80); t_control.signal(); t_link.unLock();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -