我想实现的是服从它大致接口生产者/消费者方案: class Consumer {
private:
vector<char> read(size_t n) {
// If the internal buffer has `n` elements, then dequeue them
// Otherwise wait for more data and try
我有一个单一的HW接口我想从在同一工作站上的两个应用程序(过程)的使用。硬件需要一次初始化调用,然后两个应用程序使用同一个函数(在同一个库中)与HW进行许多事务。 因此,每个应用程序应该像这样: main()
// I don't know if another app already init'ed the HW
ret = hw_init_lock(non-blocking