aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-session.h
diff options
context:
space:
mode:
Diffstat (limited to 'camel/camel-session.h')
-rw-r--r--camel/camel-session.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/camel/camel-session.h b/camel/camel-session.h
index 54eea0b1e6..0ae292f452 100644
--- a/camel/camel-session.h
+++ b/camel/camel-session.h
@@ -37,6 +37,8 @@ extern "C" {
#include <camel/camel-object.h>
#include <camel/camel-provider.h>
+#include <e-util/e-msgport.h>
+
#define CAMEL_SESSION_TYPE (camel_session_get_type ())
#define CAMEL_SESSION(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SESSION_TYPE, CamelSession))
#define CAMEL_SESSION_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SESSION_TYPE, CamelSessionClass))
@@ -60,6 +62,11 @@ struct _CamelSession
gboolean online;
};
+#ifdef ENABLE_THREADS
+typedef struct _CamelSessionThreadOps CamelSessionThreadOps;
+typedef struct _CamelSessionThreadMsg CamelSessionThreadMsg;
+#endif
+
typedef struct {
CamelObjectClass parent_class;
@@ -104,6 +111,14 @@ typedef struct {
CamelFilterDriver * (*get_filter_driver) (CamelSession *session,
const char *type,
CamelException *ex);
+#ifdef ENABLE_THREADS
+ /* mechanism for creating and maintaining multiple threads of control */
+ void *(*thread_msg_new)(CamelSession *session, CamelSessionThreadOps *ops, unsigned int size);
+ void (*thread_msg_free)(CamelSession *session, CamelSessionThreadMsg *msg);
+ int (*thread_queue)(CamelSession *session, CamelSessionThreadMsg *msg, int flags);
+ void (*thread_wait)(CamelSession *session, int id);
+#endif
+
} CamelSessionClass;
@@ -175,6 +190,26 @@ CamelFilterDriver *camel_session_get_filter_driver (CamelSession *session,
const char *type,
CamelException *ex);
+#ifdef ENABLE_THREADS
+struct _CamelSessionThreadOps {
+ void (*receive)(CamelSession *session, struct _CamelSessionThreadMsg *m);
+ void (*free)(CamelSession *session, struct _CamelSessionThreadMsg *m);
+};
+
+struct _CamelSessionThreadMsg {
+ EMsg msg;
+
+ CamelSessionThreadOps *ops;
+ int id;
+ /* user fields follow */
+};
+
+void *camel_session_thread_msg_new(CamelSession *session, CamelSessionThreadOps *ops, unsigned int size);
+void camel_session_thread_msg_free(CamelSession *session, CamelSessionThreadMsg *msg);
+int camel_session_thread_queue(CamelSession *session, CamelSessionThreadMsg *msg, int flags);
+void camel_session_thread_wait(CamelSession *session, int id);
+#endif
+
#ifdef __cplusplus
}
#endif /* __cplusplus */