Without threadsafe the code does run without any problem.
With activated threadsafe the code crashes with IMA at "ProcedureReturn".
Code: Select all
Procedure P_Thread_QueuMaster()
; This Procedure crash with enabled threadsafe at "EndProcedure" with
; a hard to find IMA.
Define tmp.l
While tmp < 1000
Delay(1)
tmp+1
Wend
EndProcedure
Define THREAD_ID_QUEUMASTER.l
THREAD_ID_QUEUMASTER = CreateThread(@P_Thread_QueuMaster(),0)
While IsThread(THREAD_ID_QUEUMASTER)
Debug "THREAD_ID_QUEUMASTER is running"
Delay(50)
Wend
Code: Select all
Procedure P_Thread_QueuMaster(bla.)
; This Procedure does not crash
Define tmp.l
While tmp < 1000
Delay(1)
tmp+1
Wend
EndProcedure
Define THREAD_ID_QUEUMASTER.l
THREAD_ID_QUEUMASTER = CreateThread(@P_Thread_QueuMaster(),0)
While IsThread(THREAD_ID_QUEUMASTER)
Debug "THREAD_ID_QUEUMASTER is running"
Delay(50)
Wend