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

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

?? thread.cpp

?? 這個(gè)動(dòng)態(tài)鏈接庫(kù)是Socket通過(guò)COm串口實(shí)現(xiàn)數(shù)據(jù)通信
?? CPP
字號(hào):
///////////////////////////////////////////////////////////////////////////////
//
// File           : $Workfile: Thread.cpp $
// Version        : $Revision: 3 $
// Function       : 
//
// Author         : $Author: Len $
// Date           : $Date: 20/05/02 23:17 $
//
// Notes          : 
//
// Modifications  :
//
// $Log: /Clients/PayPoint/e-Voucher/JetByteTools/Win32Tools/Thread.cpp $
// 
// 3     20/05/02 23:17 Len
// Updated copyright and disclaimers.
// 
// 2     10/05/02 19:25 Len
// Lint options and code cleaning.
// 
// 1     9/05/02 18:47 Len
// 
///////////////////////////////////////////////////////////////////////////////
//
// Copyright 1997 - 2002 JetByte Limited.
//
// JetByte Limited grants you ("Licensee") a non-exclusive, royalty free, 
// licence to use, modify and redistribute this software in source and binary 
// code form, provided that i) this copyright notice and licence appear on all 
// copies of the software; and ii) Licensee does not utilize the software in a 
// manner which is disparaging to JetByte Limited.
//
// This software is provided "as is" without a warranty of any kind. All 
// express or implied conditions, representations and warranties, including
// any implied warranty of merchantability, fitness for a particular purpose
// or non-infringement, are hereby excluded. JetByte Limited and its licensors 
// shall not be liable for any damages suffered by licensee as a result of 
// using, modifying or distributing the software or its derivatives. In no
// event will JetByte Limited be liable for any lost revenue, profit or data,
// or for direct, indirect, special, consequential, incidental or punitive
// damages, however caused and regardless of the theory of liability, arising 
// out of the use of or inability to use software, even if JetByte Limited 
// has been advised of the possibility of such damages.
//
// This software is not designed or intended for use in on-line control of 
// aircraft, air traffic, aircraft navigation or aircraft communications; or in 
// the design, construction, operation or maintenance of any nuclear 
// facility. Licensee represents and warrants that it will not use or 
// redistribute the Software for such purposes. 
//
///////////////////////////////////////////////////////////////////////////////

#include "Thread.h"

#include <process.h>

#include "Win32Exception.h"

///////////////////////////////////////////////////////////////////////////////
// Lint options
//
//lint -save
//lint -esym(1763, CThread::GetHandle) const member indirectly modifies obj
//
// Member not defined
//lint -esym(1526, CThread::CThread)
//lint -esym(1526, CThread::operator=)
//
///////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////
// Namespace: JetByteTools::Win32
///////////////////////////////////////////////////////////////////////////////

namespace JetByteTools {
namespace Win32 {

///////////////////////////////////////////////////////////////////////////////
// CThread
///////////////////////////////////////////////////////////////////////////////

CThread::CThread()
   :  m_hThread(INVALID_HANDLE_VALUE)
{

}
      
CThread::~CThread()
{
   if (m_hThread != INVALID_HANDLE_VALUE)
   {
      ::CloseHandle(m_hThread);
   }

   //lint -e{1540} m_hThread neither freed nor zeroed in destructor
}

HANDLE CThread::GetHandle() const
{
   return m_hThread;
}

void CThread::Start()
{
   if (m_hThread == INVALID_HANDLE_VALUE)
   {
      unsigned int threadID = 0;

      m_hThread = (HANDLE)::_beginthreadex(0, 0, ThreadFunction, (void*)this, 0, &threadID);

      if (m_hThread == INVALID_HANDLE_VALUE)
      {
         throw CWin32Exception(_T("CThread::Start() - _beginthreadex"), GetLastError());
      }
   }
   else
   {
      throw CException(_T("CThread::Start()"), _T("Thread already running - you can only call Start() once!"));
   }
}

void CThread::Wait() const
{
   if (!Wait(INFINITE))
   {
      throw CException(_T("CThread::Wait()"), _T("Unexpected timeout on infinite wait"));
   }
}

bool CThread::Wait(DWORD timeoutMillis) const
{
   // TODO base class? Waitable?
   bool ok;

   DWORD result = ::WaitForSingleObject(m_hThread, timeoutMillis);

   if (result == WAIT_TIMEOUT)
   {
      ok = false;
   }
   else if (result == WAIT_OBJECT_0)
   {
      ok = true;
   }
   else
   {
      throw CWin32Exception(_T("CThread::Wait() - WaitForSingleObject"), ::GetLastError());
   }
    
   return ok;
}

unsigned int __stdcall CThread::ThreadFunction(void *pV)
{
   int result = 0;

   CThread* pThis = (CThread*)pV;
   
   if (pThis)
   {
      try
      {
         result = pThis->Run();
      }
      catch(...)
      {
      }
   }

   return result;
}

void CThread::Terminate(
   DWORD exitCode /* = 0 */)
{
   if (!::TerminateThread(m_hThread, exitCode))
   {
      // TODO we could throw an exception here...
   }
}

///////////////////////////////////////////////////////////////////////////////
// Namespace: JetByteTools::Win32
///////////////////////////////////////////////////////////////////////////////

} // End of namespace Win32
} // End of namespace JetByteTools 

///////////////////////////////////////////////////////////////////////////////
// Lint options
//
//lint -restore
//
///////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////
// End of file...
///////////////////////////////////////////////////////////////////////////////

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲免费毛片网站| 久久综合久久99| 972aa.com艺术欧美| 一本到不卡精品视频在线观看| 国产成人免费av在线| 成人免费电影视频| 91免费观看视频在线| 在线中文字幕一区| 欧美一区日韩一区| 日韩欧美国产1| 中文字幕不卡的av| 亚洲精品日日夜夜| 久久精品国产精品青草| 国产精品资源站在线| 色综合咪咪久久| 欧美一级电影网站| 国产精品国产三级国产aⅴ中文| 亚洲欧美偷拍卡通变态| 婷婷综合五月天| 国产91高潮流白浆在线麻豆| 欧美体内she精高潮| 精品国产91久久久久久久妲己 | 国产精品久久久久久久久快鸭| 亚洲欧美日韩中文字幕一区二区三区| 亚洲国产成人91porn| 国产一区美女在线| 欧美精选一区二区| 亚洲免费在线看| 99在线精品免费| 久久九九久精品国产免费直播| 亚洲图片欧美视频| www.欧美精品一二区| 欧美成人三级电影在线| 怡红院av一区二区三区| 国产91清纯白嫩初高中在线观看| 欧美日韩精品福利| 一个色在线综合| 色综合一区二区| 综合分类小说区另类春色亚洲小说欧美 | 久久综合久久综合久久| 图片区小说区区亚洲影院| 欧美亚洲国产bt| 一区二区三区欧美激情| 在线亚洲人成电影网站色www| 国产精品高清亚洲| 粉嫩高潮美女一区二区三区 | av一区二区三区四区| 中文字幕高清一区| 成人毛片在线观看| 亚洲精品视频在线观看免费| 91久久国产综合久久| 亚洲电影在线播放| 欧美一卡2卡三卡4卡5免费| 毛片不卡一区二区| 日本一区二区不卡视频| 一本大道av伊人久久综合| 亚洲视频免费看| 制服丝袜中文字幕一区| 久久97超碰国产精品超碰| 亚洲欧美国产三级| 欧美国产国产综合| 日韩在线卡一卡二| 91网址在线看| 久久疯狂做爰流白浆xx| 亚洲欧美综合在线精品| 欧美片网站yy| 色综合中文综合网| 日韩av午夜在线观看| 国产精品久久久久久久久久久免费看| caoporm超碰国产精品| 狠狠色丁香九九婷婷综合五月| 国产日韩av一区| 91在线观看下载| 国产呦萝稀缺另类资源| 天使萌一区二区三区免费观看| 国产欧美一区二区精品性色| 欧美一区二区人人喊爽| 欧美日韩在线不卡| 99久久久久免费精品国产| 国产一区免费电影| 久久se精品一区二区| 天天操天天综合网| 亚洲韩国一区二区三区| 日韩理论在线观看| 中文字幕日韩一区二区| 国产夜色精品一区二区av| 久久久久久久性| 国产校园另类小说区| 国产欧美日韩亚州综合| 欧美国产综合色视频| 国产精品蜜臀av| 亚洲三级理论片| 亚洲区小说区图片区qvod| 亚洲色图在线看| 亚洲一区在线免费观看| 亚洲h精品动漫在线观看| 日韩电影一区二区三区四区| 久久精品国产77777蜜臀| 国产一区不卡在线| 91女神在线视频| 欧美私人免费视频| 精品国产91久久久久久久妲己| 久久精品亚洲乱码伦伦中文 | 国产成人精品影视| 欧美自拍偷拍午夜视频| 精品久久免费看| 91精品国产福利| 国产精品久久久久久久午夜片 | 色综合亚洲欧洲| 亚洲精品一区二区三区99| 中文字幕制服丝袜一区二区三区| 亚洲精选在线视频| 成人午夜私人影院| 91精品国产91热久久久做人人 | 高清国产午夜精品久久久久久| 欧美日韩三级一区| 亚洲欧洲日韩在线| 国产精品自在欧美一区| 宅男在线国产精品| 夜夜精品视频一区二区| 99视频一区二区| 国产欧美一区二区在线| 激情久久五月天| 欧美一区二区三区在线看| 亚洲欧美国产高清| aaa欧美色吧激情视频| 国产欧美一区在线| 国产一区二区h| 国产精品毛片久久久久久| 国产suv精品一区二区三区| 久久综合色综合88| 久久99精品久久久久久国产越南| 欧美久久久久久久久| 午夜久久久久久久久久一区二区| 日本精品视频一区二区三区| 亚洲欧美激情一区二区| 日本电影欧美片| 亚洲1区2区3区4区| 91精品国产色综合久久ai换脸 | 国产日产欧产精品推荐色| 久草精品在线观看| 国产精品国产自产拍高清av王其| 国产精品66部| 亚洲人成在线播放网站岛国| 色婷婷综合激情| 另类小说欧美激情| 国产精品久久久久久久久快鸭| 99久久精品国产导航| 亚洲综合偷拍欧美一区色| 91麻豆精品国产综合久久久久久| 免费观看在线综合| 国产精品美女一区二区三区| 欧美性videosxxxxx| 国产99精品国产| 亚洲.国产.中文慕字在线| 久久精品人人做人人爽人人| 欧美色男人天堂| 大陆成人av片| 精品在线你懂的| 亚洲最大的成人av| 综合久久久久久| 国产三级欧美三级日产三级99| 91免费观看视频在线| 国产一区二区网址| 日韩av电影天堂| 国产精品国产三级国产a| 欧美xxxxxxxxx| 欧美日韩一区二区三区四区| 成人一区二区三区视频| 久久99精品久久久| 奇米精品一区二区三区四区| 亚洲特级片在线| 一区视频在线播放| 综合久久国产九一剧情麻豆| 欧美国产乱子伦| 亚洲日本一区二区| 亚洲男同1069视频| 一区二区在线观看视频| 亚洲欧美另类小说| 亚洲午夜精品网| 日韩经典中文字幕一区| 日本女人一区二区三区| 免费久久99精品国产| 九色综合国产一区二区三区| 美女视频黄免费的久久| 久久国产精品第一页| 国产乱码精品1区2区3区| 成人网在线播放| 日本高清不卡在线观看| 欧美一区二区三区精品| 久久青草欧美一区二区三区| 国产精品欧美一区二区三区| 亚洲欧美日韩国产一区二区三区 | 国产在线精品一区二区夜色| 国产剧情av麻豆香蕉精品| 色综合咪咪久久| 久久―日本道色综合久久 | 风间由美一区二区三区在线观看 | 亚洲成a人v欧美综合天堂| 久久精品99久久久|