Page 1 of 1
Compiler Option: Main source file
Posted: Mon Aug 26, 2019 12:51 am
by BarryG
If I set a main source file in Compiler Options for an included source, will that included source use the same Compiler Options as the main? Or do I need to go in and set things like "Thread safe" for the include file, even if "Thread safe" is set in the main?
Re: Compiler Option: Main source file
Posted: Mon Aug 26, 2019 2:19 am
by mk-soft
It is enough to set ThreadSafe in the main program.
Re: Compiler Option: Main source file
Posted: Mon Aug 26, 2019 2:29 am
by BarryG
Good to know. I'm getting illegal memory access errors and despite triple-checking literally everything (with Purifier on and such), I just can't find the cause. Even with OnError lines support on, it reports lines that have no obvious cause. So I wondered if it were because I didn't have "thread safety" turn on in an include file. I guess not. Have to keep looking.
Re: Compiler Option: Main source file
Posted: Tue Jan 18, 2022 1:58 am
by BarryG
I never followed-up on what was causing this error. Turns out I was using procedures without any parameter for the thread, like this:
Code: Select all
Procedure MyThread()
; Do something
EndProcedure
CreateThread(@MyThread(),0)
Once I added the required procedure parameter, the crashes stopped:
Code: Select all
Procedure MyThread(null)
; Do something
EndProcedure
CreateThread(@MyThread(),0)
A silly mistake to make.
Re: Compiler Option: Main source file
Posted: Tue Jan 18, 2022 8:16 am
by HeX0R
I wouldn't call it a silly mistake, it is more a common mistake.
The sentence in the
help should be somehow highlited:
The procedure which you use as a thread must take one parameter and cannot return anything.