]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/platform-bionic.git/commit
Fix race condition in timer disarm/delete.
authorChristopher Ferris <cferris@google.com>
Tue, 21 Oct 2014 02:09:19 +0000 (19:09 -0700)
committerChristopher Ferris <cferris@google.com>
Wed, 22 Oct 2014 20:20:39 +0000 (13:20 -0700)
commit62d84b19359a8ddd3df5b6293d1b05ef5281f532
treeb614f0c9c9671eb6beaec448a7d22dc1ad44e298
parent098cf45f4e853f3c85c14af0e475bfae0839f027
Fix race condition in timer disarm/delete.

When setting a repeat timer using the SIGEV_THREAD mechanism, it's possible
that the callback can be called after the timer is disarmed or deleted.
This happens because the kernel can generate signals that the timer thread
will continue to handle even after the timer is supposed to be off.

Add two new tests to verify that disarming/deleting doesn't continue to
call the callback.

Modify the repeat test to finish more quickly than before.

Refactor the Counter implementation a bit.

Bug: 18039727

(cherry pick from commit 0724132c3263145f2a667f453a199d313a5b3d9f)

Change-Id: I135726ea4038a47920a6c511708813b1a9996c42
libc/bionic/posix_timers.cpp
tests/time_test.cpp