[evolution-data-server] CamelDataWrapper: Use the internal 'stream_lock' mutex directly.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] CamelDataWrapper: Use the internal 'stream_lock' mutex directly.
- Date: Mon, 23 Sep 2013 16:07:13 +0000 (UTC)
commit c90dcb948fb1cf78d01f7185254925ff67e2ca02
Author: Matthew Barnes <mbarnes redhat com>
Date: Sun Sep 22 07:57:21 2013 -0400
CamelDataWrapper: Use the internal 'stream_lock' mutex directly.
camel/camel-data-wrapper.c | 20 +++++++-------------
1 files changed, 7 insertions(+), 13 deletions(-)
---
diff --git a/camel/camel-data-wrapper.c b/camel/camel-data-wrapper.c
index e335d65..438a0a5 100644
--- a/camel/camel-data-wrapper.c
+++ b/camel/camel-data-wrapper.c
@@ -141,13 +141,11 @@ data_wrapper_write_to_stream_sync (CamelDataWrapper *data_wrapper,
CamelStream *memory_stream;
gssize ret;
- camel_data_wrapper_lock (
- data_wrapper, CAMEL_DATA_WRAPPER_STREAM_LOCK);
+ g_mutex_lock (&data_wrapper->priv->stream_lock);
/* Check for cancellation after locking. */
if (g_cancellable_set_error_if_cancelled (cancellable, error)) {
- camel_data_wrapper_unlock (
- data_wrapper, CAMEL_DATA_WRAPPER_STREAM_LOCK);
+ g_mutex_unlock (&data_wrapper->priv->stream_lock);
return -1;
}
@@ -163,8 +161,7 @@ data_wrapper_write_to_stream_sync (CamelDataWrapper *data_wrapper,
g_object_unref (memory_stream);
- camel_data_wrapper_unlock (
- data_wrapper, CAMEL_DATA_WRAPPER_STREAM_LOCK);
+ g_mutex_unlock (&data_wrapper->priv->stream_lock);
return ret;
}
@@ -227,19 +224,17 @@ data_wrapper_construct_from_stream_sync (CamelDataWrapper *data_wrapper,
CamelStream *memory_stream;
gssize bytes_written;
- camel_data_wrapper_lock (
- data_wrapper, CAMEL_DATA_WRAPPER_STREAM_LOCK);
+ g_mutex_lock (&data_wrapper->priv->stream_lock);
/* Check for cancellation after locking. */
if (g_cancellable_set_error_if_cancelled (cancellable, error)) {
- camel_data_wrapper_unlock (
- data_wrapper, CAMEL_DATA_WRAPPER_STREAM_LOCK);
+ g_mutex_unlock (&data_wrapper->priv->stream_lock);
return FALSE;
}
if (G_IS_SEEKABLE (stream)) {
if (!g_seekable_seek (G_SEEKABLE (stream), 0, G_SEEK_SET, cancellable, error)) {
- camel_data_wrapper_unlock (data_wrapper, CAMEL_DATA_WRAPPER_STREAM_LOCK);
+ g_mutex_unlock (&data_wrapper->priv->stream_lock);
return FALSE;
}
}
@@ -260,8 +255,7 @@ data_wrapper_construct_from_stream_sync (CamelDataWrapper *data_wrapper,
g_object_unref (memory_stream);
- camel_data_wrapper_unlock (
- data_wrapper, CAMEL_DATA_WRAPPER_STREAM_LOCK);
+ g_mutex_unlock (&data_wrapper->priv->stream_lock);
return (bytes_written >= 0);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]