Add MessageQueue for cross-thread communication

This adds a message queue that allows for sending messages of several
different types between threads. This can simplify communication with
threads that need to do periodic background work driven by certain
events (including timeouts). One example will be the metrics reporting
background thread.

See the MessageQueue class comments for examples of use.

Test: m test-art-host-gtest-art_runtime_tests
Change-Id: I831c79a4115c6b9540c2ef1801f2fa894ab96dc9
3 files changed