mozilla-b2g/platform_external_qemu — pull request #50 by vicamo (2013-11-05 09:30:43+00:00)
Title: Bug 933654: SysTimer allocated but never destroyed in handleRadioPower

rild expects `radio_state` changes right after __AT+CFUNC__ calls so we have to modify `modem->radio_state` in the command handler and returns _"OK"_ before any unsolicited response. That's the reason we had set_timer thing in [bug 877530](https://bugzilla.mozilla.org/show_bug.cgi?id=877530). This method might have racing condition when other commands come in so quick especially in automation test cases.

However, the first issue we bumped in is we just run out of all available timers, so `sys_timer_alloc` returns an invalid one. To solve the problem perfectly, I picked up some code from #16 which was meant for exactly the same thing. Details per change are available in commit long.