aboutsummaryrefslogtreecommitdiffstats
path: root/src/ginput/toggle.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ginput/toggle.c')
-rw-r--r--src/ginput/toggle.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ginput/toggle.c b/src/ginput/toggle.c
index 66021cd0..4401e295 100644
--- a/src/ginput/toggle.c
+++ b/src/ginput/toggle.c
@@ -145,6 +145,10 @@ void ginputInvertToggle(uint16_t instance, bool_t invert) {
* Returns FALSE on error (eg invalid instance)
*/
bool_t ginputGetToggleStatus(uint16_t instance, GEventToggle *ptoggle) {
+ // Win32 threads don't seem to recognise priority and/or pre-emption
+ // so we add a sleep here to prevent 100% polled applications from locking up.
+ chThdSleepMilliseconds(1);
+
if (instance >= GINPUT_TOGGLE_NUM_PORTS)
return FALSE;
ptoggle->type = GEVENT_TOGGLE;