vpthread.cpp
来自「otl简单包装实现类,对数据库进行操作的,简单易用.」· C++ 代码 · 共 69 行
CPP
69 行
/*************************************************************************** vpthread.cpp - description ------------------- begin : 11.26 15:18:00 CST 2003 copyright : (C) 2003 by |LiuZhong| email : |zliu@foundermn.com| ***************************************************************************//*************************************************************************** * * * 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. * * * ***************************************************************************/ #include "vpthread.h"VPThread::VPThread(){ m_bRunning = false; m_Pid = 0;}VPThread::~VPThread(){ if(m_bRunning){ Terminate(); } }void* VPThread::RunThread(void* pArg){// Detach(); ((VPThread*)pArg)->Run(); return NULL;}void VPThread::Run(){}void VPThread::Detach(){ pthread_detach(m_Pid);}void VPThread::Join(){ pthread_join(m_Pid,NULL);}void VPThread::Start(){ m_bRunning = true; pthread_create(&m_Pid,NULL,RunThread,this); }void VPThread::Terminate(){ m_bRunning = false;}bool VPThread::IsTerminated(){ return !m_bRunning;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?