[TIMOB-25344] Windows: New Timer implementation
| GitHub Issue | n/a |
|---|---|
| Type | Story |
| Priority | Medium |
| Status | Closed |
| Resolution | Won't Do |
| Resolution Date | 2018-07-26T03:51:43.000+0000 |
| Affected Version/s | Release 6.2.0 |
| Fix Version/s | n/a |
| Components | Windows |
| Labels | n/a |
| Reporter | Kota Iguchi |
| Assignee | Kota Iguchi |
| Created | 2017-09-26T00:55:39.000+0000 |
| Updated | 2018-07-26T03:51:43.000+0000 |
Description
According to the studies from TIMOB-25019, we found some pitfalls in current
setTimeout/setInterval implementations. There may be rare chances to encounter but we want simpler/faster/safer implementation for it.
- Make sure to clear callback right after callback is actually called from setTimeout.
- Invoke callback immediately when interval equals zero. It had synchronization issue with clearTimeout/clearInterval.
- Xaml::DispatcherTimer functions should have been called from UI thread. Use ThreadPoolTimer when possible, because it doesn't have the issue.
- With ThreadPoolTimer, make sure to invoke callback from UI thread.
Note that this is about internal implementation, so the API functionalities setTimeout/setInterval/clearTimeout/clearInterval should not be changed.
https://github.com/appcelerator/titanium_mobile_windows/pull/1116
Closing this, as current Timer implementation doesn't actually cause issues.