summaryrefslogtreecommitdiff
path: root/src/debug/remgdb
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2013-08-31 22:50:48 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2013-08-31 22:50:48 (GMT)
commit0820b68115258d7260b69a5bfb179368aa265772 (patch)
treee5fa5ec8ee1463e7467a2669105345105b563eff /src/debug/remgdb
parented4bb73e5d68c1f81b8e0c3210aa221ec6f2675b (diff)
Removed some warnings by upgrading code to GLib 2.32.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@359 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/debug/remgdb')
-rw-r--r--src/debug/remgdb/stream-int.h6
-rw-r--r--src/debug/remgdb/stream.c29
2 files changed, 17 insertions, 18 deletions
diff --git a/src/debug/remgdb/stream-int.h b/src/debug/remgdb/stream-int.h
index bdfe11a..b93ac48 100644
--- a/src/debug/remgdb/stream-int.h
+++ b/src/debug/remgdb/stream-int.h
@@ -49,11 +49,11 @@ struct _GGdbStream
GThread *listening; /* Thread pour les réceptions */
GGdbPacket *free_packets; /* Liste des disponibles */
- GMutex *free_mutex; /* Accès à la liste */
+ GMutex free_mutex; /* Accès à la liste */
GGdbPacket *recv_packets; /* Liste des paquets reçus */
- GCond *recv_cond; /* Attente de disponibilité */
- GMutex *recv_mutex; /* Accès à la liste */
+ GCond recv_cond; /* Attente de disponibilité */
+ GMutex recv_mutex; /* Accès à la liste */
};
diff --git a/src/debug/remgdb/stream.c b/src/debug/remgdb/stream.c
index 0ff442d..360c1cf 100644
--- a/src/debug/remgdb/stream.c
+++ b/src/debug/remgdb/stream.c
@@ -88,10 +88,10 @@ static void g_gdb_stream_class_init(GGdbStreamClass *klass)
static void g_gdb_stream_init(GGdbStream *stream)
{
- stream->free_mutex = g_mutex_new();
+ g_mutex_init(&stream->free_mutex);
- stream->recv_cond = g_cond_new();
- stream->recv_mutex = g_mutex_new();
+ g_cond_init(&stream->recv_cond);
+ g_mutex_init(&stream->recv_mutex);
}
@@ -111,11 +111,10 @@ static void g_gdb_stream_init(GGdbStream *stream)
bool g_gdb_stream_listen(GGdbStream *stream)
{
bool result; /* Bilan final à retourner */
- GError *error; /* Bilan de création de thread */
result = true;
- if (!g_thread_create((GThreadFunc)gdb_stream_thread, stream, FALSE, &error))
+ if (!g_thread_new("chrysalide_gdb_stream", (GThreadFunc)gdb_stream_thread, stream))
result = false;
return result;
@@ -203,11 +202,11 @@ static void *gdb_stream_thread(GGdbStream *stream)
/* On conserve le résultat */
- g_mutex_lock(stream->recv_mutex);
+ g_mutex_lock(&stream->recv_mutex);
g_gdb_packet_push(&stream->recv_packets, packet);
- g_mutex_unlock(stream->recv_mutex);
+ g_mutex_unlock(&stream->recv_mutex);
- g_cond_signal(stream->recv_cond);
+ g_cond_signal(&stream->recv_cond);
}
@@ -244,7 +243,7 @@ GGdbPacket *g_gdb_stream_get_free_packet(GGdbStream *stream)
{
GGdbPacket *result; /* Paquet à retourner */
- g_mutex_lock(stream->free_mutex);
+ g_mutex_lock(&stream->free_mutex);
if (dl_list_empty(stream->free_packets))
result = g_gdb_packet_new();
@@ -252,7 +251,7 @@ GGdbPacket *g_gdb_stream_get_free_packet(GGdbStream *stream)
else
result = g_gdb_packet_pop(&stream->free_packets);
- g_mutex_unlock(stream->free_mutex);
+ g_mutex_unlock(&stream->free_mutex);
return result;
@@ -274,11 +273,11 @@ GGdbPacket *g_gdb_stream_get_free_packet(GGdbStream *stream)
void g_gdb_stream_mark_packet_as_free(GGdbStream *stream, GGdbPacket *packet)
{
- g_mutex_lock(stream->free_mutex);
+ g_mutex_lock(&stream->free_mutex);
g_gdb_packet_push(&stream->free_packets, packet);
- g_mutex_unlock(stream->free_mutex);
+ g_mutex_unlock(&stream->free_mutex);
}
@@ -389,14 +388,14 @@ GGdbPacket *g_gdb_stream_recv_packet(GGdbStream *stream)
{
GGdbPacket *result; /* Paquet à retourner */
- g_mutex_lock(stream->recv_mutex);
+ g_mutex_lock(&stream->recv_mutex);
if (dl_list_empty(stream->recv_packets))
- g_cond_wait(stream->recv_cond, stream->recv_mutex);
+ g_cond_wait(&stream->recv_cond, &stream->recv_mutex);
result = g_gdb_packet_pop(&stream->recv_packets);
- g_mutex_unlock(stream->recv_mutex);
+ g_mutex_unlock(&stream->recv_mutex);
return result;