aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Jeppsson <mathias.jeppsson@sonyericsson.com>2011-02-25 15:57:50 +0100
committerJaikumar Ganesh <jaikumar@google.com>2011-05-25 11:51:57 -0700
commit007af38ddeb22f02663a2d879634642b61457634 (patch)
tree9eb64fe12fc125924b02a5662a608c2a643515a8
parent5ca3dfce0e1c35f913f569049bd3f89204bddf92 (diff)
downloadbluez-007af38ddeb22f02663a2d879634642b61457634.tar.gz
Signal client thread in error cases.
When the a2dp_thread has finished executing one command, it signals the client thread. Some error cases do not signal and due to this calls to liba2dp will hang until the client thread times out. Add signaling in error cases to avoid calls to liba2dp to hang. Change-Id: Ic6eae5af3ed4f40c0eb022aba35ed4e0d3f81904
-rwxr-xr-xaudio/liba2dp.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/audio/liba2dp.c b/audio/liba2dp.c
index f562084c..62f52d49 100755
--- a/audio/liba2dp.c
+++ b/audio/liba2dp.c
@@ -272,8 +272,11 @@ static int bluetooth_start(struct bluetooth_data *data)
error:
/* close bluetooth connection to force reinit and reconfiguration */
- if (data->state == A2DP_STATE_STARTING)
+ if (data->state == A2DP_STATE_STARTING) {
bluetooth_close(data);
+ /* notify client that thread is ready for next command */
+ pthread_cond_signal(&data->client_wait);
+ }
return err;
}
@@ -928,8 +931,11 @@ static int bluetooth_configure(struct bluetooth_data *data)
error:
- if (data->state == A2DP_STATE_CONFIGURING)
+ if (data->state == A2DP_STATE_CONFIGURING) {
bluetooth_close(data);
+ /* notify client that thread is ready for next command */
+ pthread_cond_signal(&data->client_wait);
+ }
return err;
}