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

📄 cubbyhole.java

📁 this code is a parallel programming code . such code is esay but is very useful to understand how to
💻 JAVA
字号:
/* =========================================================    CubbyHole   CubbyHole is a synchronized storage location for a single   value of type Object.    CubbyHole has two methods. Put and Get. Both are   synchronized so one cannot run whilst other threads are   running synchronized methods (i.e. Put and Get) within   this Object.    ========================================================= */public class CubbyHole{  private Object contents;  /* ==========================================================      Method for getting an Object from the buffer     ==========================================================  */  public synchronized Object get() {    return contents;  }  /* ==========================================================     Method for putting object into buffer     ==========================================================  */  public synchronized void put(Object value) {    contents = value;  }}

⌨️ 快捷键说明

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