[Spice-devel,spice-server] Rename self field to thread_id

Submitted by Frediano Ziglio on Nov. 24, 2016, 10:48 a.m.

Details

Message ID 20161124104824.10884-2-fziglio@redhat.com
State Accepted
Commit 8fcfd9a4dfea4b3dcac9dadb6bf4755da72b9b49
Headers show
Series "dcc: Remove unneeded private header inclusion" ( rev: 2 ) in Spice

Not browsing as part of any series.

Commit Message

Frediano Ziglio Nov. 24, 2016, 10:48 a.m.
self is usually used for GObject, avoid confusion.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
---
 server/dispatcher.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/server/dispatcher.c b/server/dispatcher.c
index 44624cc..f0479aa 100644
--- a/server/dispatcher.c
+++ b/server/dispatcher.c
@@ -47,7 +47,7 @@  G_DEFINE_TYPE(Dispatcher, dispatcher, G_TYPE_OBJECT)
 struct DispatcherPrivate {
     int recv_fd;
     int send_fd;
-    pthread_t self;
+    pthread_t thread_id;
     pthread_mutex_t lock;
     DispatcherMessage *messages;
     int stage;  /* message parser stage - sender has no stages */
@@ -136,7 +136,7 @@  static void dispatcher_constructed(GObject *object)
     pthread_mutex_init(&self->priv->lock, NULL);
     self->priv->recv_fd = channels[0];
     self->priv->send_fd = channels[1];
-    self->priv->self = pthread_self();
+    self->priv->thread_id = pthread_self();
 
     self->priv->messages = g_new0(DispatcherMessage,
                                   self->priv->max_message_type);
@@ -420,5 +420,5 @@  int dispatcher_get_recv_fd(Dispatcher *dispatcher)
 
 pthread_t dispatcher_get_thread_id(Dispatcher *self)
 {
-    return self->priv->self;
+    return self->priv->thread_id;
 }

Comments

Acked-by: Christophe Fergeau <cfergeau@redhat.com>

On Thu, Nov 24, 2016 at 10:48:23AM +0000, Frediano Ziglio wrote:
> self is usually used for GObject, avoid confusion.
> 
> Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
> ---
>  server/dispatcher.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/server/dispatcher.c b/server/dispatcher.c
> index 44624cc..f0479aa 100644
> --- a/server/dispatcher.c
> +++ b/server/dispatcher.c
> @@ -47,7 +47,7 @@ G_DEFINE_TYPE(Dispatcher, dispatcher, G_TYPE_OBJECT)
>  struct DispatcherPrivate {
>      int recv_fd;
>      int send_fd;
> -    pthread_t self;
> +    pthread_t thread_id;
>      pthread_mutex_t lock;
>      DispatcherMessage *messages;
>      int stage;  /* message parser stage - sender has no stages */
> @@ -136,7 +136,7 @@ static void dispatcher_constructed(GObject *object)
>      pthread_mutex_init(&self->priv->lock, NULL);
>      self->priv->recv_fd = channels[0];
>      self->priv->send_fd = channels[1];
> -    self->priv->self = pthread_self();
> +    self->priv->thread_id = pthread_self();
>  
>      self->priv->messages = g_new0(DispatcherMessage,
>                                    self->priv->max_message_type);
> @@ -420,5 +420,5 @@ int dispatcher_get_recv_fd(Dispatcher *dispatcher)
>  
>  pthread_t dispatcher_get_thread_id(Dispatcher *self)
>  {
> -    return self->priv->self;
> +    return self->priv->thread_id;
>  }
> -- 
> 2.9.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel