Author: ArcRiley Date: 2009-02-27 12:38:51 -0500 (Fri, 27 Feb 2009) New Revision: 1535
Modified: trunk/concordance/include/concordance.h trunk/concordance/include/concordance.sockets.h trunk/concordance/src/_core/__init__.c trunk/concordance/src/_core/step.c trunk/concordance/src/sockets/Socket.c Log: clear labeling of "call" vs "return" queues Socket objects are now creating their own return queues Modified: trunk/concordance/include/concordance.h =================================================================== --- trunk/concordance/include/concordance.h 2009-02-27 17:38:45 UTC (rev 1534) +++ trunk/concordance/include/concordance.h 2009-02-27 17:38:51 UTC (rev 1535) @@ -46,13 +46,13 @@ GMainContext* context; /* Concordance's Glib context */ GMainLoop* mainloop; /* Concordance's Glib mainloop */ GThread* threadid; /* thread ID for mainloop thread */ - GAsyncQueue* queueRecv; /* callback queue input */ + GAsyncQueue* queueCall; /* callback queue input */ } concordGlobals; typedef struct { PyObject* self; gchar* method; - GAsyncQueue* queueSend; /* callback queue output */ + GAsyncQueue* queueReturn; /* callback queue output */ GString* message; } concordCore_QueueMsg; Modified: trunk/concordance/include/concordance.sockets.h =================================================================== --- trunk/concordance/include/concordance.sockets.h 2009-02-27 17:38:45 UTC (rev 1534) +++ trunk/concordance/include/concordance.sockets.h 2009-02-27 17:38:51 UTC (rev 1535) @@ -40,8 +40,9 @@ PyObject* module; /* reference to our own module */ GMainContext* context; /* Concordance's Glib context */ Gsasl* saslCntx; /* Concordance's SASL context */ - GAsyncQueue* queueRecv; /* callback queue input */ - GAsyncQueue* queueSend; /* callback queue output */ + GAsyncQueue* queueCall; /* callback queue input (global) */ + GAsyncQueue* queueXMPP; /* callback queue output for XMPP */ + GAsyncQueue* queueSASL; /* callback queue output for SASL */ GHashTable* domains; /* domain->service lookup */ const gchar* addr; gushort port; Modified: trunk/concordance/src/_core/__init__.c =================================================================== --- trunk/concordance/src/_core/__init__.c 2009-02-27 17:38:45 UTC (rev 1534) +++ trunk/concordance/src/_core/__init__.c 2009-02-27 17:38:51 UTC (rev 1535) @@ -111,12 +111,11 @@ */ globals->context = g_main_context_new(); - /* create callback queues + /* create global callback queue GAsyncQueue* g_async_queue_new (void); */ - globals->queueRecv = g_async_queue_new(); - globals->queueSend = g_async_queue_new(); + globals->queueCall = g_async_queue_new(); /* launch _core_loop thread Modified: trunk/concordance/src/_core/step.c =================================================================== --- trunk/concordance/src/_core/step.c 2009-02-27 17:38:45 UTC (rev 1534) +++ trunk/concordance/src/_core/step.c 2009-02-27 17:38:51 UTC (rev 1535) @@ -57,7 +57,7 @@ GTimeVal *end_time); */ Py_BEGIN_ALLOW_THREADS - popped = g_async_queue_timed_pop(globals->queueRecv, &popEnd); + popped = g_async_queue_timed_pop(globals->queueCall, &popEnd); Py_END_ALLOW_THREADS /* return if the pop call timed out */ @@ -135,7 +135,7 @@ void g_async_queue_push (GAsyncQueue *queue, gpointer data); */ - g_async_queue_push(popped->queueSend, popped); + g_async_queue_push(popped->queueReturn, popped); } else /* free message struct since we didn't use it */ Modified: trunk/concordance/src/sockets/Socket.c =================================================================== --- trunk/concordance/src/sockets/Socket.c 2009-02-27 17:38:45 UTC (rev 1534) +++ trunk/concordance/src/sockets/Socket.c 2009-02-27 17:38:51 UTC (rev 1535) @@ -285,17 +285,22 @@ self->context = ((concordGlobals*) PyModule_GetState(state->_core))->context; self->saslCntx = state->saslCntx; - self->queueRecv = ((concordGlobals*) - PyModule_GetState(state->_core))->queueRecv; - self->queueSend = ((concordGlobals*) - PyModule_GetState(state->_core))->queueSend; + self->queueCall = ((concordGlobals*) + PyModule_GetState(state->_core))->queueCall; + + /* create callback return queues + + GAsyncQueue* g_async_queue_new (void); + */ + self->queueXMPP = g_async_queue_new(); + self->queueSASL = g_async_queue_new(); /* create new domains hashtable GHashTable* g_hash_table_new_full (GHashFunc hash_func, GEqualFunc key_equal_func, - GDestroyNotify key_destroy_func, - GDestroyNotify value_destroy_func); + GDestroyNotify key_destroy_func, + GDestroyNotify value_destroy_func); */ self->domains = g_hash_table_new_full(g_str_hash, g_str_equal, _______________________________________________ PySoy-SVN mailing list PySoy-SVN@pysoy.org http://www.pysoy.org/mailman/listinfo/pysoy-svn