Skip to content

Commit

Permalink
hthread
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyneu committed Feb 17, 2018
1 parent f17ca04 commit efad01e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 31 deletions.
21 changes: 9 additions & 12 deletions tool3/MainFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,11 @@ HWND hc,hz;
CButton *bh;
CButton *q;
CStatic *b7[3];
HANDLE cl[3];
HANDLE cl;

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
cl[0]=CreateEvent(NULL,1,0,NULL);
cl[1]=CreateEvent(NULL,1,0,NULL);
cl[2]=CreateEvent(NULL,1,0,NULL);
cl=CreateEvent(NULL,1,0,NULL);
if (CWnd::OnCreate(lpCreateStruct) == -1)
return -1;
bh=new CButton();
Expand Down Expand Up @@ -163,7 +161,6 @@ int cr,f,b,terminator;
VOID c(VOID *x)
{
const byte c=(byte)x;
ResetEvent(cl[c]);
q->EnableWindow();
bh->EnableWindow(0);
CWin32Heap stringHeap(HEAP_NO_SERIALIZE, 0, 0);
Expand Down Expand Up @@ -344,24 +341,23 @@ VOID c(VOID *x)
free(transaction->serializedData);
free(transaction->scriptSig);
free(transaction->pubkeyScript);
free(transaction);SetEvent(cl[c]);
free(transaction);
bren = 5;
SetEvent(cl[c]);
break;
}
}
}


CWinThread *rew;
CWinThread *rew[3];
int terminator2;

void CMainFrame::tr()
{
bren=0;
AfxBeginThread((AFX_THREADPROC)c,(LPVOID)0,0,1400000);
AfxBeginThread((AFX_THREADPROC)c,(LPVOID)1,0,1400000);
AfxBeginThread((AFX_THREADPROC)c,(LPVOID)2,0,1400000);
rew[0]=AfxBeginThread((AFX_THREADPROC)c,(LPVOID)0);
rew[1]=AfxBeginThread((AFX_THREADPROC)c,(LPVOID)1);
rew[2]=AfxBeginThread((AFX_THREADPROC)c,(LPVOID)2);
}

void CMainFrame::w()
Expand Down Expand Up @@ -393,7 +389,8 @@ void CMainFrame::OnClose()
wchar_t w[140],ferrum[198];
if(terminator2)
{
DWORD c = WaitForMultipleObjects(3,cl,0,20000); // 20 seconds
HANDLE t[]={rew[0]->m_hThread,rew[1]->m_hThread,rew[2]->m_hThread};
DWORD c = WaitForMultipleObjects(3,t,1,20000); // 20 seconds
// if(c==WAIT_TIMEOUT)
CWnd::OnClose();
}
Expand Down
19 changes: 0 additions & 19 deletions tool3/tool3.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,6 @@

#include "resource.h" // main symbols

_declspec(align(16)) struct triggerblock
{
_declspec(align(16)) double q;
_declspec(align(16)) long long block[3];
_declspec(align(16)) long long b;
_declspec(align(16)) long long t;
_declspec(align(16)) tm *c;
_declspec(align(16)) tm *p;
_declspec(align(16)) BYTE ptrigger;
_declspec(align(16)) float outofthis;
_declspec(align(16)) double x;
_declspec(align(16)) long double F;
_declspec(align(16)) short finishup;
_declspec(align(16)) double f;
_declspec(align(16)) BYTE E;
};



struct Transaction{
#ifdef _MSC_VER
#pragma pack(1)
Expand Down
Binary file modified x64/Release/tool3.exe
Binary file not shown.

0 comments on commit efad01e

Please sign in to comment.