mirror of
https://github.com/Artikash/Textractor.git
synced 2024-12-24 01:14:12 +08:00
refactor textthread a little
This commit is contained in:
parent
79d39ce135
commit
2cf987bef5
@ -17,7 +17,7 @@ struct RepeatCountNode {
|
|||||||
|
|
||||||
struct ThreadParameter {
|
struct ThreadParameter {
|
||||||
DWORD pid; // jichi: 5/11/2014: The process ID
|
DWORD pid; // jichi: 5/11/2014: The process ID
|
||||||
DWORD hook;
|
DWORD hook; // Artikash 6/6/2018: The start address of the hook
|
||||||
DWORD retn; // jichi 5/11/2014: The return address of the hook
|
DWORD retn; // jichi 5/11/2014: The return address of the hook
|
||||||
DWORD spl; // jichi 5/11/2014: the processed split value of the hook parameter
|
DWORD spl; // jichi 5/11/2014: the processed split value of the hook parameter
|
||||||
};
|
};
|
||||||
|
@ -23,6 +23,10 @@ template<class T, int default_size, class fComp=BinaryEqual<T> >
|
|||||||
class MyVector
|
class MyVector
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
int Used() const { return used; }
|
||||||
|
T *Storage() const { return storage; }
|
||||||
|
void LockVector() { EnterCriticalSection(&cs_store); }
|
||||||
|
void UnlockVector() { LeaveCriticalSection(&cs_store); }
|
||||||
MyVector() : size(default_size), used(0)
|
MyVector() : size(default_size), used(0)
|
||||||
{
|
{
|
||||||
InitializeCriticalSection(&cs_store);
|
InitializeCriticalSection(&cs_store);
|
||||||
@ -39,6 +43,7 @@ public:
|
|||||||
DeleteCriticalSection(&cs_store);
|
DeleteCriticalSection(&cs_store);
|
||||||
storage = 0;
|
storage = 0;
|
||||||
}
|
}
|
||||||
|
protected:
|
||||||
|
|
||||||
void Reset()
|
void Reset()
|
||||||
{
|
{
|
||||||
@ -110,11 +115,8 @@ public:
|
|||||||
//if (storage[i]==item) {c=i;break;}
|
//if (storage[i]==item) {c=i;break;}
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
int Used() const { return used; }
|
|
||||||
T *Storage() const { return storage; }
|
|
||||||
void LockVector() { EnterCriticalSection(&cs_store); }
|
|
||||||
void UnlockVector() { LeaveCriticalSection(&cs_store); }
|
|
||||||
protected:
|
|
||||||
CRITICAL_SECTION cs_store;
|
CRITICAL_SECTION cs_store;
|
||||||
int size,
|
int size,
|
||||||
used;
|
used;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user