+
+/*
+ * Bind a thread to a context. (It's inline merely to speed things up.)
+ */
+static INLINE void become_session(CitContext *which_con) {
+/*
+ pid_t tid = syscall(SYS_gettid);
+*/
+ pthread_setspecific(MyConKey, (void *)which_con );
+/*
+ syslog(LOG_DEBUG, "[%d]: Now doing %s\n",
+ (int) tid,
+ ((which_con != NULL) && (which_con->ServiceName != NULL)) ?
+ which_con->ServiceName:"");
+*/
+}
+
+
+
+/* typedef void (*CtdlDbgFunction) (const int); */
+
+extern int DebugSession;
+#define CONDBGLOG(LEVEL) if ((LEVEL != LOG_DEBUG) || (DebugSession != 0))
+
+#define CON_syslog(LEVEL, FORMAT, ...) \
+ CONDBGLOG(LEVEL) syslog(LEVEL, \
+ "%s Context: " FORMAT, IOSTR, __VA_ARGS__)
+
+#define CONM_syslog(LEVEL, FORMAT) \
+ CONDBGLOG(LEVEL) syslog(LEVEL, \
+ "%s Context: " FORMAT, IOSTR);
+
+