aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmdsclient/comm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libmdsclient/comm.h')
-rw-r--r--src/libmdsclient/comm.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/libmdsclient/comm.h b/src/libmdsclient/comm.h
index 46f9ed1..833fa97 100644
--- a/src/libmdsclient/comm.h
+++ b/src/libmdsclient/comm.h
@@ -53,19 +53,29 @@ typedef struct libmds_connection
/**
* Mutex used to hinder concurrent modification
* and concurrent message passing
+ *
+ * This mutex is a fast mutex, a thread may not
+ * lock it more than once
*/
pthread_mutex_t mutex;
+ /**
+ * Whether `mutex` is initialised
+ */
+ int mutex_initialised;
+
} libmds_connection_t;
/**
- * Initialise a connection descriptor with the the default values
+ * Initialise a connection descriptor
*
- * @param this The connection descriptor
+ * @param this The connection descriptor
+ * @return Zero on success, -1 on error, `ernno`
+ * will have been set accordingly on error
*/
__attribute__((nonnull))
-void libmds_connection_initialise(libmds_connection_t* restrict this);
+int libmds_connection_initialise(libmds_connection_t* restrict this);
/**
* Allocate and initialise a connection descriptor