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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cthread.h

?? 研讀AxCrypt對加解密的處理方法
?? H
字號:
#pragma once
#ifndef AXPIPE_CTHREAD_H
#define AXPIPE_CTHREAD_H
/*! \file CThread.h
    \brief Threading dummy base and template wrapper AxPipe::CNoThread and AxPipe::CThread<>

    @(#) $Id: CThread.h,v 1.2 2004/01/01 20:05:54 svante Exp $

    AxPipe - Binary Stream Framework

    Copyright (C) 2003 Svante Seleborg/Axon Data, All rights reserved.

    This program is free software; you can redistribute it and/or modify it under the terms
    of the GNU General Public License as published by the Free Software Foundation;
    either version 2 of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
    without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    See the GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along with this program;
    if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
    Boston, MA 02111-1307 USA

    The author may be reached at mailto:axpipe@axondata.se and http://axpipe.sourceforge.net

    Why is this framework released as GPL and not LGPL?
    See http://www.gnu.org/philosophy/why-not-lgpl.html

----
\verbatim
    CThread.h                       Threading dummy base and template wrapper

    E-mail                          YYYY-MM-DD              Reason
    axpipe@axondata.se              2003-12-05              Initial
\endverbatim
*/
#include "AxPipe.h"

#include "AxAssert.h"
#define AXLIB_ASSERT_FILE "CThread.h"

namespace AxPipe {
    using AxLib::OutputDebugStringF;

/// \brief Dummy non-threaded base-class for all CSource, CSink and CPipe derived classes.
/// \see CSource
/// \see CSink
/// \see CPipe
/// \see CThread
///
/// Mostly placeholders in the case we later derive from CThread, in which case the virtuals
/// here get overridden with real thread-handling and synchronizating functionality. Some
/// basic code that is common is defined here.
class CNoThread {
protected:
    bool m_fExit;                           ///< Set to true when the derived object is to exit.
    bool m_fAutoDeleteSink;                 ///< Set to true if the derived object's sink is to self-destruct with the pipe-line.
    
    /// \brief Initalize one Work-cycle, processing one CSeg.
    virtual void WorkStart() {              
    }
    /// \brief Start Work() on one CSeg.
    virtual void WorkSignal() {
        Work();
    }
    /// \brief End one Work-cycle.
    virtual void WorkEnd() {
    }
    /// \brief Wait for a new CSeg to arrive to work on.
    virtual void WorkWait() {
    }
    /// \brief Wait for the Work()-thread, if any, to terminate.
    virtual void WorkExitWait() {
    }
    /// \brief Actually process one CSeg.
    virtual void Work() = 0;
public:
    CNoThread() {
        m_fAutoDeleteSink = m_fExit = false;
    }
    /// \brief Wait for the Work() thread to finish if it's processing.
    ///
    /// Defined here, but only has function in threaded version.
    /// Start and End one Work cycle, thereby ensuring that the
    /// previous one has finished.
    void WaitForIdle() {
        WorkStart();
        WorkEnd();
    }
    /// \brief Run-time type identifcation.
    ///
    /// We're not using the built in RTTI because we sometimes want to be able
    /// to forego most of the run time library, as well as exceptions and RTTI.
    ///
    /// The point here is to create a guaranteed unique value that is the same
    /// for all instances of a class, while not requiring any inits outside
    /// of the class declaration, and also to 'fool' optimizing compilers, so
    /// that they cannot perform global optimization and figure out that it can
    /// fold identical functions into one. It happened in a previous version...
    /// That's why we include the static int, it can't be optimized away, at least
    /// not easily.
    /// You need to override ClassId() and RTClassId() in all derived clases you
    /// want to distinguish, this is
    /// most easily done by simply copying and pasting exactly these definitions.
    /// There is also the Run-Time version, accessible through a pointer to a
    /// polymorphic base-class for example, RTClassId().
    static void *ClassId() {
        static int i;
        return &i;
    }

    /// \brief Run-Time version of our type identification.
    /// \see ClassId()
    virtual void *RTClassId() {
        return ClassId();
    }
};

/// \brief Only used as a ThreadProc to get back into the class.
/// \param lpParam The 'this' pointer of the class where this is run.
//static inline DWORD WINAPI CThreadProc(LPVOID lpParam);

#pragma warning (push)
// Disable 'this' : used in base member initializer list
#pragma warning (disable: 4355)
/// \brief Template to implement a pipe-section in a separate thread.
///
/// The basic thread mechanism revolves around a number of virtual
/// functions that are overriden here, such as
/// Work(). All synchronization etc is handled by the class, and
/// the Work() function is called in it's own thread.
///
/// To enable threading use the appropriate CSource, CPipe or CSink derived
/// class as the argument.
/// \param T A CSource, CPipe or CSink derived class to run in a separate thread.
template <class T> class CThreadNoRun : public CThreadMain<T> {
    CThreadSync m_ThreadSync;               ///< Implement worker thread synchronization.

public:
    
    /// \brief Wait for the worker thread to terminate, then close handles etc.
    virtual ~CThreadNoRun() {
        if (!m_fExit) {
            SetError(ERROR_CODE_INTERNAL, ERROR_MSG_INTERNAL, _T("CThread::~CThread Exit() not called"));
        }
    }

public:
    /// \brief Initiate one Work() cycle - called from outside worker thread.
    void WorkStart() {
        m_ThreadSync.WorkStart();
    }

    /// \brief Signal that we've prepared for more Work() - called from outside worker thread.
    void WorkSignal() {
        m_ThreadSync.WorkSignal();
    }
    
    /// \brief Wait for more to be ready for Work() - this is called in the worker thread.
    void WorkWait() {
        m_ThreadSync.WorkWait();
    }
    
    /// \brief End one Work() cycle - called from the worker thread.
    void WorkEnd() {
        m_ThreadSync.WorkEnd();
    }
    
    /// \brief Wait for the Work()-thread, if any, to terminate.
    virtual void WorkExitWait() {
        Wait();
    }
};

/// \brief Thread wrapper for AxPipe CSource, CPipe and CSink derived classes.
///
/// Setup a thread, start it running and pump data through the Work() member
/// function, using thread synchronization. Basically all Out* and In* functions
/// will run in the context of this separate thread.
template <class T> class CThread : public CThreadNoRun<T> {
public:
    CThread() {
        Run();
    }
private:
    /// \brief The ThreadProc for the worker thread
    /// \return Always 0, not the thread exit code.
    virtual int Main() {
        OutputDebugStringF(_T("CThread()::Main() ID=%X\n"), GetCurrentThreadId());
        while (!m_fExit) {
            // Elesewhere WorkStart() and WorkSignal() will be called
            WorkWait();                     // Wait for more to do
            Work();
            WorkEnd();
        }
        OutputDebugStringF(_T("CThread()::Main() ID=%X WaitForIdle()...\n"), GetCurrentThreadId());
        WaitForIdle();                      // Ensure that the last work is done.
        // This is to handle a memory leak bug in Win32, where an exiting
        // thread being a fibre does not clean up after itself. See Q185231 or KB185231.
		// Update 2005-05-20: And the really, really great thing is they fixed the bug in Windows Server 2003,
		// causing the delete by the system to result in a double free on the heap and making the program
		// crash! So the fix breaks the documented work-around - and there is no documented way to determine
		// if the fix is in or not! Aaaaarghhhh. What to do? We let the memory leak.
		//
        // If we have successfully allocated a TLS index
        if (AxPipe::dwTlsIndex != TLS_OUT_OF_INDEXES) {
            // If we have converted this thread into a fiber
            if (TlsGetValue(AxPipe::dwTlsIndex) != NULL) {
                // Then we do the free to avoid the memory leak as per above.
				//See above! ::LocalFree(GetCurrentFiber());
            }
        }
        OutputDebugStringF(_T("CThread()::Main() ...exiting thread ID=%X\n"), GetCurrentThreadId());
        return 0;
    }

};

/// \brief Start a CSource in a separate thread.
/// A CSource derived class will be setup to Drain() in
/// it's own thread.
/// \see Main()
/// \param T A CSource derived class to start in it's own thread.
template <class T> class CThreadSource : public CThreadMain<T> {
private:
    /// \brief The ThreadProc for the worker thread
    /// Do Open()->Drain()->Close()->Plug();
    /// \return Always 0, not the thread exit code.
    virtual int Main() {
        Open()->Drain()->Close()->Plug();
        return 0;
    }
};

#pragma warning (pop)

}; // namespace AxPipe
#endif AXPIPE_CTHREAD_H

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美色网站导航| 国产乱码精品一区二区三 | 亚洲综合色丁香婷婷六月图片| 日韩一级片网站| 欧美另类久久久品| 欧美精品v日韩精品v韩国精品v| 欧美色综合影院| 欧美日韩在线播| 欧美一卡二卡三卡| 精品国精品国产尤物美女| 精品剧情v国产在线观看在线| 欧美成人精品福利| 久久久久久久网| 国产三级欧美三级| 中文字幕人成不卡一区| 亚洲天堂成人在线观看| 一区二区三区在线观看视频| 亚洲国产成人精品视频| 欧美aⅴ一区二区三区视频| 日韩av二区在线播放| 久久国产夜色精品鲁鲁99| 国产乱子伦视频一区二区三区 | 国产在线国偷精品产拍免费yy| 久久福利资源站| 国产经典欧美精品| 91麻豆swag| 欧美日本韩国一区| 久久在线免费观看| 亚洲美女在线一区| 免费不卡在线视频| 成人三级伦理片| 欧美日韩另类一区| 国产女人水真多18毛片18精品视频 | 激情深爱一区二区| 成人性生交大片免费看中文网站| 日本乱人伦aⅴ精品| 日韩一区二区在线免费观看| 国产色91在线| 视频一区二区中文字幕| 国产成人在线视频免费播放| 欧美午夜理伦三级在线观看| 精品国产91久久久久久久妲己| 国产精品不卡视频| 日本特黄久久久高潮| 成人av在线资源网站| 91麻豆精品国产综合久久久久久| 国产日韩欧美不卡在线| 日韩精品亚洲专区| 91香蕉视频黄| 国产亚洲制服色| 日韩成人一区二区| 91蝌蚪porny成人天涯| 2020国产精品自拍| 天堂午夜影视日韩欧美一区二区| 成人精品视频.| 日韩午夜电影在线观看| 亚洲欧洲综合另类| 国产精品综合二区| 日韩欧美一区二区三区在线| 一区二区三区四区蜜桃| 成人精品国产一区二区4080| 精品美女一区二区三区| 日韩制服丝袜先锋影音| 欧美中文字幕一区二区三区| 国产精品久久看| 国产成人在线免费观看| 精品理论电影在线观看| 美洲天堂一区二卡三卡四卡视频| 在线观看网站黄不卡| 亚洲天堂中文字幕| 99久免费精品视频在线观看 | 色香蕉久久蜜桃| 欧美经典一区二区| 国产伦精一区二区三区| 久久色.com| 国产九九视频一区二区三区| 精品国产百合女同互慰| 激情综合五月婷婷| 久久视频一区二区| 岛国av在线一区| 国产精品久久久久国产精品日日| 成人免费毛片app| 国产精品免费久久| 91在线观看视频| 亚洲欧美日韩久久精品| 色88888久久久久久影院按摩| 亚洲自拍与偷拍| 欧美色中文字幕| 国产91精品一区二区| 精品国产a毛片| 国产精品白丝av| 国产精品色哟哟网站| 色综合天天综合网天天看片| 一区二区日韩电影| 91精品国产综合久久久蜜臀图片| 免费精品视频在线| 久久久www免费人成精品| 成人免费黄色在线| 亚洲综合在线视频| 日韩精品专区在线| 成人丝袜视频网| 亚洲最大的成人av| 精品久久久久香蕉网| 风间由美一区二区三区在线观看| 亚洲手机成人高清视频| 欧美精品日日鲁夜夜添| 国产精品主播直播| 亚洲一卡二卡三卡四卡五卡| 日韩精品一区二区三区视频| 成人免费看视频| 午夜久久久久久久久久一区二区| 久久综合九色综合欧美98 | 欧美色图免费看| 九九精品一区二区| 亚洲精品五月天| 欧美成人性战久久| 日本韩国精品在线| 国产在线精品一区二区不卡了 | 亚洲视频小说图片| 欧美电影免费观看高清完整版| 国产成人精品亚洲日本在线桃色 | 久久久亚洲欧洲日产国码αv| 91免费精品国自产拍在线不卡| 日本大胆欧美人术艺术动态| 国产精品蜜臀在线观看| 日韩久久精品一区| 欧美日韩视频在线第一区| 成人性生交大片免费看视频在线| 日韩电影在线观看网站| 亚洲欧美另类小说| 国产精品日韩成人| 欧美刺激午夜性久久久久久久 | 91精品免费在线| 色偷偷成人一区二区三区91 | 本田岬高潮一区二区三区| 日本三级韩国三级欧美三级| 亚洲人成网站色在线观看| 精品美女一区二区| 在线成人小视频| 欧美唯美清纯偷拍| 色综合婷婷久久| av亚洲精华国产精华精| 大胆亚洲人体视频| 国产精品一区在线观看你懂的| 日韩高清欧美激情| 亚洲va韩国va欧美va精品| 亚洲乱码国产乱码精品精的特点 | 成人午夜短视频| 久久国产尿小便嘘嘘| 日韩成人dvd| 日日骚欧美日韩| 婷婷开心激情综合| 午夜不卡av在线| 天堂影院一区二区| 日本不卡的三区四区五区| 五月婷婷色综合| 亚洲综合在线五月| 日韩制服丝袜先锋影音| 日韩成人午夜电影| 紧缚捆绑精品一区二区| 精彩视频一区二区| 国产传媒日韩欧美成人| 丁香一区二区三区| 99久久精品国产导航| 99精品在线观看视频| 不卡大黄网站免费看| 97se亚洲国产综合在线| 91视频国产资源| 欧美在线观看一区二区| 7878成人国产在线观看| 91麻豆精品国产自产在线 | 精品国产污污免费网站入口| 精品乱人伦一区二区三区| 26uuu国产日韩综合| 久久久不卡网国产精品一区| 中文字幕一区二区三区不卡 | 青青草97国产精品免费观看 | 久久久久99精品一区| 国产日本一区二区| 亚洲综合激情另类小说区| 秋霞电影网一区二区| 国产成都精品91一区二区三| av高清久久久| 欧美一区二区在线免费播放| 久久久国产一区二区三区四区小说| 欧美国产日韩亚洲一区| 一二三区精品视频| 日韩av电影天堂| www.成人在线| 欧美精品三级在线观看| 国产精品视频免费看| 午夜日韩在线观看| 丰满白嫩尤物一区二区| 欧美日韩国产一级二级| 日本一区二区三区久久久久久久久不| 亚洲一区二区欧美| 国产很黄免费观看久久| 欧美日本视频在线| 国产精品久久久久影视| 蜜臀精品久久久久久蜜臀|