blackberry-webworks/BB10-WebWorks-Framework — pull request #46 by miwong (2012-05-28 15:39:43+00:00)
Title: Fixing Issue 105:  connectionchange event uses 100% CPU time

Issue fixed: blackberry/BB10-WebWorks-Framework#105

The previous implementation of the connectionchange event used a busy-wait loop and ended events using a flag. This hogged the CPU and drained the battery unnecessarily. The implementation was changed to use a blocking call to bps_get_event() instead. To end events, a custom event is sent to the secondary thread. When this event is received, the event loop ends.