Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3688

Thread ignoring Sleep but works initially 2024 R4.2

$
0
0

I have several Threads, each with a sender.Sleep(8000) at the bottom of the loop, and everything works as it should, normally.

For some reason it’s as if all the Threads in my app suddenly start ignoring the Sleep statement, but execute the code both before and after Sleep line, rapidly over and over.

I’ve set up counters outside of the loop, to make sure it isn’t a new Thread being instantiated, and as I expected the counter increments - showing me that the same Thread/Loop is running.

Once the Threads stop honoring the sender.Sleep() they continue to ignore it, until I restart the app.

The call to ‘Sleep’ is done in the Method defined as the AddHandler for the Thread’s .Run event.

Here’s an example of how I’m instantiating the Thread…

' start scanner_MONITOR_LOCKS (thread)
scanner_MONITOR_LOCKS = New xThread_class
scanner_MONITOR_LOCKS.Priority = Thread.NormalPriority

AddHandler scanner_MONITOR_LOCKS.Run, AddressOf scanner_MONITOR_LOCKS_action
scanner_MONITOR_LOCKS.Start()

3 posts - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 3688

Trending Articles