The threadsafe switch doesn't seem to matter in terms of preventing the freeze, nor does it matter which debugger I use.
Just wondering if anyone can confirm that I am not going nuts! It took an age for me to track down an occasional lock up in a far bigger program than this, but have whittled it down to this small snippet and am just a little puzzled especially as the problem disappears if I disable the debugger or comment out the PauseThread() (only 90% sure about this)!
Could the PauseThread() be also pausing the debugger (which makes sense) which in turn is pausing the main process somehow? If so, why does this problem only occur intermittently?
Code: Select all
;The occasionally freezes on my system : PB 5.62x64, Win 7.
;Comment out the PauseThread() or disable the debugger to remove the problem (apparently!)
Procedure thread(param)
Repeat
Delay(100)
ForEver
EndProcedure
threadID = CreateThread(@thread(), 0)
PauseThread(threadID)
If OpenWindow(0, 0, 0, 222, 200, "ButtonGadgets", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ButtonGadget(0, 10, 10, 200, 20, "Standard Button")
Repeat
ev = WaitWindowEvent()
Until ev = #PB_Event_CloseWindow
EndIf
Thanks.