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

📄 table.h

📁 nachos下线程与同步的实验
💻 H
字号:
#include "synch-sleep.h"

class Table 
{
      public:
             Table(int size); // create a table to hold at most 'size' entries.
             ~Table();  //析构函数 
             
             // allocate a table slot for 'object'.
             // return the table index for the slot or -1 on error.
             int Alloc(void *object);
             
             // return the object from table index 'index' or NULL on error.
             // (assert index is in range).  Leave the table entry allocated
             // and the pointer in place.
             void *Get(int index);
             
             // free a table slot
             void Release(int index);
             
      private:
              Lock *lock; 
              int* L;  //
              int* value;  //value[0..S-1]:each value in the table
              int S;  //the size of table
};

⌨️ 快捷键说明

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