#include "errno.h"
#include "pthread.h"
#include "stdafx.h"
#include
#include "lock.h"
class MyClass: public InstanceLockBase
{} ;
MyClass mc;
void pthread_join();
void pthread_create();
extern "C" static DWORD WINAPI CreateOnceProcess(LPVOID pArg)
{
pthread_t t0;
pthread_t t1;
if (pthread_create(&t0,NULL,ThreadProcNet,NULL) ==-1)
error(_T("无法重新启动"));
Sleep(10000);
InstanceLock il( & mc); //加互斥锁
if (pthread_create(&t1,NULL,ThreadProcNetNew,NULL) ==-1)
error(_T("无法重新启动"));
Sleep(10000);
InstanceLock li( & mc); //加互斥锁
pthread_t t2;
if (pthread_create(&t2,NULL,ThreadProcNet,NULL) ==-1)
{ SetThreadPriority(&t2,THREAD_PRIORITY_HIGHEST );
error("请关闭文华财经wh8_sp"); }
Sleep(10000);
void *result;
if (pthread_join(t2,&result) ==-1)
error("请关闭文华财经wh8_sp");
return 0;
if(pthread_join(t1,&result)==-1)
error("请关闭文华财经wh8_sp");
if(pthread_join(t0,&result)==-1)
error("请关闭文华财经wh8_sp");
return 0;
}
希望能贴出完整的抓取代码,我是初学C++,谢谢!