aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-folder-pt-proxy.c
diff options
context:
space:
mode:
authorbertrand <Bertrand.Guiheneuf@aful.org>1999-09-17 06:26:03 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>1999-09-17 06:26:03 +0800
commit63039bb99edd9f8c7aea9ef4ce8700d713b01354 (patch)
treedc00b13ddd4399787049b6fac9adce7b25da81c4 /camel/camel-folder-pt-proxy.c
parentc6da2725e05030af92353147a37a5f559e5f3a42 (diff)
downloadgsoc2013-evolution-63039bb99edd9f8c7aea9ef4ce8700d713b01354.tar
gsoc2013-evolution-63039bb99edd9f8c7aea9ef4ce8700d713b01354.tar.gz
gsoc2013-evolution-63039bb99edd9f8c7aea9ef4ce8700d713b01354.tar.bz2
gsoc2013-evolution-63039bb99edd9f8c7aea9ef4ce8700d713b01354.tar.lz
gsoc2013-evolution-63039bb99edd9f8c7aea9ef4ce8700d713b01354.tar.xz
gsoc2013-evolution-63039bb99edd9f8c7aea9ef4ce8700d713b01354.tar.zst
gsoc2013-evolution-63039bb99edd9f8c7aea9ef4ce8700d713b01354.zip
New object. Operation queue. Meant to be used in non-blocking proxy
1999-09-17 bertrand <Bertrand.Guiheneuf@aful.org> * camel/camel-op-queue.h: * camel/camel-op-queue.c: New object. Operation queue. Meant to be used in non-blocking proxy objects. svn path=/trunk/; revision=1231
Diffstat (limited to 'camel/camel-folder-pt-proxy.c')
-rw-r--r--camel/camel-folder-pt-proxy.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/camel/camel-folder-pt-proxy.c b/camel/camel-folder-pt-proxy.c
index 1e7bf4ffa0..0d7bc3c957 100644
--- a/camel/camel-folder-pt-proxy.c
+++ b/camel/camel-folder-pt-proxy.c
@@ -20,6 +20,26 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
+
+/* FIXME :
+ *
+ * the current implementation lauches requests
+ * on the real folder without bothering on wether
+ * the global mutex (folder->mutex) is locked or
+ * not.
+ * This means that you could have 100 threads
+ * waiting for the mutex at the same time.
+ * This is not really a bug, more a nasty feature ;)
+ *
+ * This will be solved when the CORBA proxy is
+ * written, as we will need to queue the requests
+ * on the client side. The same queue mechanism
+ * will be used for the pthread proxy
+ *
+ */
+
+
+
#include <config.h>
#include "camel-folder-pt-proxy.h"
#include "camel-log.h"
@@ -154,6 +174,10 @@ _finalize (GtkObject *object)
}
+
+
+/* folder->init_with_store implementation */
+
typedef struct {
CamelFolder *folder;
CamelStore *parent_store;
@@ -168,6 +192,10 @@ _async_init_with_store (_InitStoreParam *param)
proxy_folder = CAMEL_FOLDER_PT_PROXY (folder);
real_folder = proxy_folder->real_folder;
+
+ /* we may block here but we are actually in a
+ * separate thread, so no problem
+ */
g_static_mutex_lock (&(proxy_folder->mutex));
CF_CLASS (real_folder)->init_with_store (real_folder, param->parent_store);
@@ -183,10 +211,16 @@ _init_with_store (CamelFolder *folder, CamelStore *parent_store)
_InitStoreParam *param;
pthread_t init_store_thread;
+ /* param will be freed in _async_init_with_store */
param = g_new (_InitStoreParam, 1);
param->folder = folder;
param->parent_store = parent_store;
+ /*
+ * call _async_init_with_store in a separate thread
+ * the thread may block on a mutex, but not the main
+ * thread.
+ */
pthread_create (&init_store_thread, NULL , (thread_call_func)_async_init_with_store, param);
}
@@ -194,6 +228,11 @@ _init_with_store (CamelFolder *folder, CamelStore *parent_store)
+/* folder->open implementation */
+typedef struct {
+ CamelFolder *folder;
+ CamelFolderOpenMode mode;
+} _openFolderParam;
static void
_open (CamelFolder *folder, CamelFolderOpenMode mode)