⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wait_queue.h

📁 多线程库
💻 H
字号:
#ifndef __THREAD_WAIT_QUEUE_H#define __THREAD_WAIT_QUEUE_H#include <thread_spinlock.h>#include <thread_attributes.h>#define __THREAD_QUEUE_MAX    64class wait_queue {private:  int w_id;  attributes::scope w_scope;  struct storage {    int w_magic;    short top,bottom;    spinlock w_sync;    int pid[__THREAD_QUEUE_MAX];  } *_wq;  void init(attributes::scope);public:  wait_queue(int);  wait_queue(attributes::scope);  wait_queue();  ~wait_queue();  bool empty();  void insert(int);  void remove(int);  void suspend_me();  void wake_up();};#endif /* __THREAD_WAIT_QUEUE_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -