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

Commit db0295dc authored by git-zhenye.broadcom.com's avatar git-zhenye.broadcom.com Committed by Android Git Automerger
Browse files

am 48f40d47: Fixed deadlock issue for concurrent multiple rfcomm connections.

* commit '48f40d47':
  Fixed deadlock issue for concurrent multiple rfcomm connections.
parents 36b07e42 48f40d47
Loading
Loading
Loading
Loading
+8 −1
Original line number Original line Diff line number Diff line
@@ -897,7 +897,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
                    //make sure there's data pending in case the peer closed the socket
                    if(!(flags & SOCK_THREAD_FD_EXCEPTION) ||
                    if(!(flags & SOCK_THREAD_FD_EXCEPTION) ||
                                (ioctl(rs->fd, FIONREAD, &size) == 0 && size))
                                (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
                else
                {
                {