#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++,谢谢!
不知道你这个问题是否已经解决, 如果还没有解决的话:这是因为windows下缺少pthread的动态链接库,我们需要将解压包里面的.\pthreads-w32-2-9-1-release\Pre-built.2\dll\x86\pthreadVC2.dll
放置到C:\Windows\SysWOW64
下即可解决。
如果放置了解压包里面dll文件夹下x64的pthreadVC2.dll就会出现错误应用程序无法正常启动0xc000007b