Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12744: winapi::set_timer_resolution inadvertently changes timer resolution (Windows)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2018-03-01 19:49:37
#12744: winapi::set_timer_resolution inadvertently changes timer resolution
(Windows)
-------------------------------------+------------------------------
Reporter: Terry Kim <yuminkim@â¦> | Owner: Ion Gaztañaga
Type: Bugs | Status: closed
Milestone: To Be Determined | Component: interprocess
Version: Boost 1.63.0 | Severity: Problem
Resolution: fixed | Keywords: timer resolution
-------------------------------------+------------------------------
Comment (by anonymous):
I know this bug is closed, but I wanted to add a comment explaining the
previous behavior. I just spent 2 days tracking down why our timer
resolution was getting messed up. (We were using a previous Boost
version).
First of all, the call to NtSetTimerResolution is a private ntdll
function. Not an API you should be using, or especially assuming the
behavior of. There is no official documentation. The second argument
(called 'set') that was false, is not meant to be a benign query of the
timer resolution. Instead, it 'unsets' the process's request for a custom
timer resolution. This would be used by the proper Public api in
winmm.dll and the calls for timeBeginPeriod/timeEndPeriod.
By calling NtSetTimerResolution with set=false. Future calls to
timeBeginPeriod/timeEndPeriod had no effect if there was already a
timeBeginPeriod call outstanding. Most likely winmm (which likely tracks
the pairs of timeBeginPeriod/timeEndPeriod calls) was now out of sync with
its interaction with ntdll.
-- Ticket URL: <https://svn.boost.org/trac10/ticket/12744#comment:3> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2018-03-01 19:53:54 UTC