csharp newbie
csharp newbie

Reputation: 638

unhandled read exception in thread after passing class into thread

http://pastebin.com/QPab6nkp is all my code, pretty messy and unfinished.

I found where is an error - i think im passing philosophist exemplar into thread incorectly, because into the thread, philosophist *ph = static_cast<philosophist*>(params); - that ph variable contains some garbage numbers insead of what i've passed (591519915,-519258915 and so on). Of course when i try to getID of philosophist, there is no such id in array of semaphors, gSems. How to pass that class into thread correctly?

Upvotes: 0

Views: 63

Answers (1)

csharp newbie
csharp newbie

Reputation: 638

_beginthreadex(NULL, 0, &philosophistFunction, ph1, 0, 0);
there is no need for & before ph1

Upvotes: 0

Related Questions