Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 48f40d47 authored by git-zhenye.broadcom.com's avatar git-zhenye.broadcom.com
Browse files

Fixed deadlock issue for concurrent multiple rfcomm connections.

Bug 15469934

Change-Id: I77a3dc97c92f0ccd5764220e8e0bf5c0689d7b12
parent 52f504ff
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -888,7 +888,14 @@ void btsock_rfc_signaled(int fd, int flags, uint32_t user_id)
                    //make sure there's data pending in case the peer closed the socket
                    if(!(flags & SOCK_THREAD_FD_EXCEPTION) ||
                                (ioctl(rs->fd, FIONREAD, &size) == 0 && size))
                        BTA_JvRfcommWrite(rs->rfc_handle, (UINT32)rs->id);
                    {
                        int rfc_handle = rs->rfc_handle;
                        UINT32 rs_id = rs->id;
                        //unlock before BTA_JvRfcommWrite to avoid deadlock on concurrnet multi rfcomm connectoins
                        unlock_slot(&slot_lock);
                        BTA_JvRfcommWrite(rfc_handle, rs_id);
                        return;
                    }
                }
                else
                {