diff options
author | pliard@chromium.org <pliard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-05 09:25:22 +0000 |
---|---|---|
committer | pliard@chromium.org <pliard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-05 09:25:22 +0000 |
commit | a316c8cd7aebaa34f50f24749dce25fcb7367e32 (patch) | |
tree | 541105ae7bfd65e00dc0833ba14a569a47b7ffb4 /native_client_sdk | |
parent | c057982f78dea39819f71ba2771f3d646d77e3fd (diff) | |
download | chromium_src-a316c8cd7aebaa34f50f24749dce25fcb7367e32.zip chromium_src-a316c8cd7aebaa34f50f24749dce25fcb7367e32.tar.gz chromium_src-a316c8cd7aebaa34f50f24749dce25fcb7367e32.tar.bz2 |
Refactor cygprofile.cc, drop support for non-Android and add unit tests.
This refactors cygprofile.cc by:
- Removing unnecessary uses of pthread_self().
- Splitting the CygTlsLog class into two pieces: ThreadLog and
ThreadLogsManager. ThreadLog is the per-thread trace log while
ThreadLogsManager is the global instance that manages individual trace logs
and handles flushing through its internal thread.
- Encapsulating more state (e.g. the vector of trace logs).
- Minimizing global state by removing the CygCommon class.
- Enforcing immutability in various places which allows more type-safety and
less locking in particular.
- Sanitizing locking mechanisms: |ThreadLogsManager::lock_| and
|ThreadLog::lock_| are now never acquired at the same time and critical
sections are shortened to avoid subtle lock interactions.
- Flushing only from the background flush thread to mitigate the observer
effect.
This also drops support for non-Android platforms since it was randomly
deadlocking at best. See the detailed comment at the top of cygprofile.h for
more information.
Additionally this introduces cygprofile.h which exposes the necessary bits for
the new unit tests added in cygprofile_unittest.cc.
BUG=372323
R=pasko@chromium.org
Review URL: https://codereview.chromium.org/296793004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275045 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk')
0 files changed, 0 insertions, 0 deletions