亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? buffers.h

?? 多任務(wù)操作系統(tǒng)控制的DOS環(huán)境下的實(shí)現(xiàn)的C語言源程序。 利用時(shí)間片的方式
?? H
字號(hào):
//--------------------------------------------------------------------------
//
//      BUFFERS.H: header file for DOSMonitor-based bounded buffer.
//      Copyright (c) J.English 1993.
//      Author's address: je@unix.brighton.ac.uk
//
//      Permission is granted to use copy and distribute the
//      information contained in this file provided that this
//      copyright notice is retained intact and that any software
//      or other document incorporating this file or parts thereof
//      makes the source code for the library of which this file
//      is a part freely available.
//
//--------------------------------------------------------------------------
//
//      Revision history:
//      1.0     March 1993      Initial coding
//
//--------------------------------------------------------------------------

#ifndef __BUFFERS_H
#define __BUFFERS_H

#include "threads.h"

//--------------------------------------------------------------------------
//
//      Class BoundedBuffer.
//
//      This is a template for a DOSMonitor-based bounded buffer.
//      The constructor requires the size of the buffer as a parameter.
//      The member functions "get" and "put" allow individual data items
//      to be taken out of and put into the buffer.  The member function
//      "close" allows the buffer to be closed against further use.  The
//      member function "items" returns the number of items currently in
//      the buffer.
//
template<class T> class BoundedBuffer : public DOSMonitor
{
  public:
    BoundedBuffer (unsigned n)  : buffer(new T[n]), buffersize(n),
                                  count(0), inptr(0), outptr(0), closed(0)
                                { }
    ~BoundedBuffer ()           { delete [] buffer; }

    unsigned items ()           { return count; }

    int get (T& item);          // get an item from the buffer
    int put (const T& item);    // put an item into the buffer
    void close ();              // close buffer against further use

  private:
    DOSMonitorQueue full;
    DOSMonitorQueue empty;
    T* buffer;
    unsigned buffersize;
    unsigned count;
    unsigned inptr;
    unsigned outptr;
    unsigned closed;
};

//--------------------------------------------------------------------------
//
//      BoundedBuffer::get.
//
//      Get an item from the buffer.  The thread will be suspended on the
//      "empty" queue as long as the buffer is empty or until the buffer
//      is closed.  If the buffer is closed, the function will return 0.
//      Otherwise, the next item is extracted and the "inptr" is moved
//      to point to the next item.  Finally, any threads waiting while the 
//      buffer is full are resumed (since there is now an empty space in
//      the buffer) and the value 1 is returned to indicate success.
//
template <class T> int BoundedBuffer<T>::get (T& item)
{
    lock ();
    while (count == 0 && !closed)
        suspend (empty);        // await non-empty buffer
    if (count != 0)
    {   item = buffer [inptr++];
        inptr %= buffersize;
        count--;
        resume (full);          // awaken threads waiting for non-full buffer
    }
    unlock ();
    return !closed;
}


//--------------------------------------------------------------------------
//
//      BoundedBuffer::put.
//
//      Put an item into the buffer.  The thread will be suspended on the
//      "full" queue as long as the buffer is empty or until the buffer
//      is closed.  If the buffer is closed, the function will return 0.
//      Otherwise, the item is stored in the next available space and
//      "outptr" is moved to point to the next free space.  Finally,
//      any threads waiting while the buffer was empty are resumed (since
//      there is now an item in the buffer) and the value 1 is returned
//      to indicate success.
//
template <class T> int BoundedBuffer<T>::put (const T& item)
{
    lock ();
    while (count == buffersize && !closed)
        suspend (full);         // await non-full buffer
    if (count != buffersize)
    {   buffer [outptr++] = item;
        outptr %= buffersize;
        count++;
        resume (empty);         // awaken threads waiting for non-empty buffer
    }
    unlock ();
    return !closed;
}

//--------------------------------------------------------------------------
//
//      BoundedBuffer::close.
//
//      This function closes the buffer against further use.  The "closed"
//      flag is set and any suspended threads are resumed.  This is to guard
//      against situations where a thread might wait forever for an item
//      which never arrives, which would prevent the program from ever
//      terminating.
//
template <class T> void BoundedBuffer<T>::close ()
{
    lock ();
    closed = 1;
    resume (full);
    resume (empty);
    unlock ();
}

#endif

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品啪在线观看国产60岁| 久久综合九色综合97婷婷女人| 捆绑调教一区二区三区| 国产精品日产欧美久久久久| 欧美日韩中文字幕一区| 成人av资源在线| 蜜桃视频在线观看一区| 亚洲国产成人porn| 国产欧美精品一区| 欧美一级片在线看| 欧美视频一区在线观看| 成人动漫在线一区| 国产一区二区三区美女| 日本不卡中文字幕| 亚洲一区二区三区四区的 | 最新欧美精品一区二区三区| 日韩欧美中文字幕公布| 欧美精品高清视频| 在线免费观看不卡av| 99re这里只有精品视频首页| 国产成人免费视频精品含羞草妖精 | 精品成人一区二区三区四区| 欧美日韩国产一二三| 日本韩国欧美在线| 99久久99久久免费精品蜜臀| 国产精品一线二线三线精华| 美女www一区二区| 天天亚洲美女在线视频| 亚洲一二三四在线| 一区二区三区中文在线| 亚洲欧美日韩小说| 综合欧美亚洲日本| 亚洲视频一区在线观看| 亚洲欧美日韩国产另类专区| 国产精品久久三| 中文字幕国产精品一区二区| 欧美高清一级片在线观看| 欧美国产1区2区| 成人免费在线观看入口| 中文字幕欧美一区| 亚洲欧美一区二区不卡| 一区二区欧美在线观看| 亚洲韩国一区二区三区| 日日骚欧美日韩| 天天av天天翘天天综合网| 午夜精品爽啪视频| 日韩有码一区二区三区| 久久精品久久综合| 国产中文一区二区三区| 国产mv日韩mv欧美| 91热门视频在线观看| 91久久精品一区二区| 欧美影院一区二区| 欧美妇女性影城| 精品日韩99亚洲| 久久久午夜电影| 国产精品国产三级国产aⅴ原创 | 韩国精品一区二区| 盗摄精品av一区二区三区| 成人app下载| 欧美三级一区二区| 精品免费国产二区三区| 国产亚洲一本大道中文在线| 亚洲日本乱码在线观看| 日本aⅴ亚洲精品中文乱码| 免费av网站大全久久| 国产成人小视频| 91看片淫黄大片一级| 在线不卡一区二区| 久久久蜜臀国产一区二区| 亚洲日本丝袜连裤袜办公室| 调教+趴+乳夹+国产+精品| 国产成人在线免费| 欧美精品一区二区三区高清aⅴ | 一本久久精品一区二区| 欧美日韩高清一区二区三区| 精品国产成人系列| 中文字幕一区免费在线观看 | av一区二区三区| 欧美丰满一区二区免费视频| 久久网这里都是精品| 一区二区三区av电影| 国产资源精品在线观看| 欧洲精品一区二区| 久久蜜桃香蕉精品一区二区三区| 亚洲免费观看高清完整版在线观看| 日韩国产精品91| 97久久久精品综合88久久| 欧美成人一级视频| 亚洲一二三四区| 成人免费福利片| 欧美精品在线一区二区三区| 日本一区二区三区国色天香 | 久久精品免费看| 91成人免费在线| 亚洲国产精品av| 美脚の诱脚舐め脚责91| 在线视频欧美精品| 国产性做久久久久久| 美腿丝袜亚洲综合| 欧美性xxxxx极品少妇| 欧美激情中文不卡| 麻豆成人免费电影| 欧美狂野另类xxxxoooo| 亚洲精品视频一区| 粉嫩嫩av羞羞动漫久久久| 日韩欧美一区在线观看| 亚洲国产一区二区视频| 成人激情综合网站| 精品99久久久久久| 蜜桃视频第一区免费观看| 在线精品视频一区二区| 国产精品久久久爽爽爽麻豆色哟哟| 久久99九九99精品| 制服丝袜一区二区三区| 亚洲一区二区三区小说| 色综合咪咪久久| 国产精品网站在线播放| 国产高清精品网站| 久久综合久久综合亚洲| 美女一区二区视频| 91精品国产免费久久综合| 亚洲成人精品在线观看| 色狠狠色噜噜噜综合网| 一区二区三区91| 在线免费观看成人短视频| 亚洲一区影音先锋| 欧美午夜精品一区二区蜜桃| 有码一区二区三区| 91极品美女在线| 亚洲综合色视频| 欧美人与z0zoxxxx视频| 午夜亚洲国产au精品一区二区| 欧美日韩精品福利| 日韩高清不卡一区| 精品欧美一区二区久久| 麻豆免费精品视频| 欧美成人性战久久| 国产经典欧美精品| 欧美国产欧美综合| 成人18精品视频| 最新国产成人在线观看| 在线免费观看日本欧美| 亚洲444eee在线观看| 91精品综合久久久久久| 美女www一区二区| 久久久久久影视| 成人午夜在线视频| 亚洲卡通动漫在线| 欧美日韩一区高清| 蜜乳av一区二区| 国产亚洲精品超碰| 99久久精品国产观看| 国产精品羞羞答答xxdd| 国产欧美一区二区精品性色| 成人精品视频一区二区三区尤物| 亚洲美腿欧美偷拍| 欧美丰满少妇xxxxx高潮对白| 久久国产精品一区二区| 欧美国产在线观看| 欧美午夜精品久久久久久孕妇| 天天综合色天天综合| 久久久精品黄色| 色综合久久66| 美女视频免费一区| 中文字幕日韩av资源站| 91精品国产综合久久精品app| 精品一区二区三区影院在线午夜| 国产欧美精品国产国产专区| 91久久免费观看| 韩国理伦片一区二区三区在线播放 | 91在线观看免费视频| 日韩精品国产欧美| 国产女人aaa级久久久级| 欧美伊人久久久久久久久影院| 久久国产欧美日韩精品| 亚洲丝袜精品丝袜在线| 日韩欧美第一区| 色婷婷av一区二区三区大白胸| 奇米精品一区二区三区在线观看| 国产精品二三区| 51午夜精品国产| 97久久超碰精品国产| 久久草av在线| 一区二区三区四区国产精品| 精品国产第一区二区三区观看体验| 99vv1com这只有精品| 国产综合色产在线精品 | 国产精品资源站在线| 亚洲宅男天堂在线观看无病毒| 精品国内片67194| 在线国产亚洲欧美| 国产乱码精品一区二区三区五月婷| 亚洲激情欧美激情| 欧美国产日产图区| 精品欧美一区二区久久| 欧美精品一级二级三级| 91在线一区二区三区| 国产激情视频一区二区三区欧美 | 日精品一区二区|