Sure, here u go with main.cpp file - should be enough to show the problem. I can't afford to use static functions in this case.
#include "UltraEngine.h"
using namespace UltraEngine;
class testclass {
private:
void test2(const int start, const int size);
void test();
};
void testclass::test2(const int start, const int size)
{
int i;
for (int num = start; num <= start + size; num++) {
//something here
}
}
void testclass::test() {
int thread_count = 40;
int range = 65535;
vector<shared_ptr<Thread> > threads(thread_count);
for (int n = 0; n < thread_count; ++n)
{
threads[n] = CreateThread(bind((test2), range / thread_count * n, range / thread_count), true);
}
for (int n = 0; n < 40; ++n)
{
threads[n]->Wait();
}
}
int main(int argc, const char* argv[])
{
return 0;
}