Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C - C++ Learning > thread security...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 4288 of 4370
Post > Topic >>

thread security of templates

by Gerhard Wolf <quisquiliae@[EMAIL PROTECTED] > Sep 25, 2008 at 01:51 PM

Hi,

i have just solved a thread EAccessVilation Problem in my TThread 
(C++Builder). The problem was that i have accessed a function from a 
other module inside the threads execute block:

------------------------------------------------------------------------
int returnFunctionValue() {
  test = Form1->MyClass->function();
}


void __fastcall Automatic::Execute() {
....
while (Terminated) {
....
	Synchronize(&returnFunctionValue);	//the solution
	test = Form1->MyClass->function();	//the error
....
}
}
------------------------------------------------------------------------
i solved this by a seperate function which ist called by a Synchronize.

NOW THE QUESTION ;-)

can i use templates defined in my main.h inside the thread-modules 
execute block without Synchronize without gettint this EAccessViolation?
 




 1 Posts in Topic:
thread security of templates
Gerhard Wolf <quisquil  2008-09-25 13:51:17 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 8:49:45 CST 2008.