OSDN Git Service

Queue: Wait for unregistration if on different thread
authorHansong Zhang <hsz@google.com>
Tue, 3 Mar 2020 20:43:23 +0000 (12:43 -0800)
committerHansong Zhang <hsz@google.com>
Tue, 3 Mar 2020 21:11:07 +0000 (13:11 -0800)
commit481353667529bb86689e171981711c786781d21e
tree2c0886053b949647ae392c2ddf5fdc13db7fce09
parentb0e3826ac4253a0752a8daef2b6a748e3ec8c44c
Queue: Wait for unregistration if on different thread

Before Queue object is deleted, we must make sure that the enqueue or
dequeue callback isn't executing. If on same thread, callbacks are
synchronized. If on different thread, we must wait for unregistration to
synchronize callbacks.

Test: bluetooth_test_gd
Bug: 150174451
Change-Id: Id3c980aa0bf7bd9fa10c33c5cca3751df38f7d97
gd/os/linux_generic/queue.tpp
gd/os/linux_generic/queue_unittest.cc