[vte] Remove chunk mutex



commit fb9a0d3727c12c0dd5de384335050bb416d33815
Author: Behdad Esfahbod <behdad behdad org>
Date:   Fri Sep 4 21:20:30 2009 -0400

    Remove chunk mutex
    
    We always get called in from the mainloop and hence are essentially
    single-threaded.

 src/vte.c |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)
---
diff --git a/src/vte.c b/src/vte.c
index 22e0482..5589e75 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -169,17 +169,14 @@ static GTimer *process_timer;
 
 /* process incoming data without copying */
 static struct _vte_incoming_chunk *free_chunks;
-G_LOCK_DEFINE_STATIC(free_chunks);
 static struct _vte_incoming_chunk *
 get_chunk (void)
 {
 	struct _vte_incoming_chunk *chunk = NULL;
-	G_LOCK (free_chunks);
 	if (free_chunks) {
 		chunk = free_chunks;
 		free_chunks = free_chunks->next;
 	}
-	G_UNLOCK (free_chunks);
 	if (chunk == NULL) {
 		chunk = g_new (struct _vte_incoming_chunk, 1);
 	}
@@ -190,17 +187,14 @@ get_chunk (void)
 static void
 release_chunk (struct _vte_incoming_chunk *chunk)
 {
-	G_LOCK (free_chunks);
 	chunk->next = free_chunks;
 	chunk->len = free_chunks ? free_chunks->len + 1 : 0;
 	free_chunks = chunk;
-	G_UNLOCK (free_chunks);
 }
 static void
 prune_chunks (guint len)
 {
 	struct _vte_incoming_chunk *chunk = NULL;
-	G_LOCK (free_chunks);
 	if (len && free_chunks != NULL) {
 	    if (free_chunks->len > len) {
 		struct _vte_incoming_chunk *last;
@@ -215,7 +209,6 @@ prune_chunks (guint len)
 	    chunk = free_chunks;
 	    free_chunks = NULL;
 	}
-	G_UNLOCK (free_chunks);
 	while (chunk != NULL) {
 		struct _vte_incoming_chunk *next = chunk->next;
 		g_free (chunk);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]