diff options
author | zzy <zhenye@broadcom.com> | 2012-09-20 21:19:10 -0700 |
---|---|---|
committer | The Android Automerger <android-build@android.com> | 2012-09-21 15:43:02 -0700 |
commit | ea634cea46f9dc34eed1fc4c7c95cf46dd70f375 (patch) | |
tree | e2304a192f7dcfbae7f7c0c46eda330eb5bf2a71 /hci/include/utils.h | |
parent | 5d79d92af3d2ceb60194f36a608f1702c6d717d4 (diff) | |
download | external_bluetooth_bluedroid-ea634cea46f9dc34eed1fc4c7c95cf46dd70f375.zip external_bluetooth_bluedroid-ea634cea46f9dc34eed1fc4c7c95cf46dd70f375.tar.gz external_bluetooth_bluedroid-ea634cea46f9dc34eed1fc4c7c95cf46dd70f375.tar.bz2 |
bluedroid: add mutex lock when enumerating the hci tx queue
Bug: 7167816
Bug: 7136940
This could be fix for most of the hci timeout issues. The root cause seemed
like the while loop for sending hci message messed up when another thread try
to enque/deque a hci message at same time.
Change-Id: Ib7f6a68b49b700b0d575326cafae41a158483b27
Signed-off-by: Iliyan Malchev <malchev@google.com>
Diffstat (limited to 'hci/include/utils.h')
-rw-r--r-- | hci/include/utils.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/hci/include/utils.h b/hci/include/utils.h index be4406b..0f1517c 100644 --- a/hci/include/utils.h +++ b/hci/include/utils.h @@ -111,6 +111,17 @@ void *utils_dequeue (BUFFER_Q *p_q); /******************************************************************************* ** +** Function utils_dequeue_unlocked +** +** Description Dequeues a buffer from the head of the given queue without lock +** +** Returns NULL if queue is empty, else buffer +** +*******************************************************************************/ +void *utils_dequeue_unlocked (BUFFER_Q *p_q); + +/******************************************************************************* +** ** Function utils_getnext ** ** Description Return a pointer to the next buffer linked to the given buffer @@ -134,6 +145,18 @@ void *utils_remove_from_queue (BUFFER_Q *p_q, void *p_buf); /******************************************************************************* ** +** Function utils_remove_from_queue_unlocked +** +** Description Dequeue the given buffer from the middle of the given queue without lock +** +** Returns NULL if the given queue is empty, else the given buffer +** +*******************************************************************************/ +void *utils_remove_from_queue_unlocked (BUFFER_Q *p_q, void *p_buf); + + +/******************************************************************************* +** ** Function utils_delay ** ** Description sleep unconditionally for timeout milliseconds |