static unsigned char cmd_text_buf[CMDBUFSIZE];
void *cmd_text_mutex = NULL;
-#define Cbuf_LockThreadMutex() (void)(cmd_text_mutex ? Thread_LockMutex(cmd_text_mutex) : 0)
-#define Cbuf_UnlockThreadMutex() (void)(cmd_text_mutex ? Thread_UnlockMutex(cmd_text_mutex) : 0)
-
/*
============
Cbuf_AddText
int found;
cmd_function_t *cmd;
cmdalias_t *a;
-
+ if (lockmutex)
+ Cbuf_LockThreadMutex();
oldpos = cmd_tokenizebufferpos;
cmd_source = src;
found = false;
done:
cmd_tokenizebufferpos = oldpos;
+ if (lockmutex)
+ Cbuf_UnlockThreadMutex();
}
#ifndef CMD_H
#define CMD_H
+extern void *cmd_text_mutex;
+#define Cbuf_LockThreadMutex() (void)(cmd_text_mutex ? Thread_LockMutex(cmd_text_mutex) : 0)
+#define Cbuf_UnlockThreadMutex() (void)(cmd_text_mutex ? Thread_UnlockMutex(cmd_text_mutex) : 0)
+
/// allocates an initial text buffer that will grow as needed
void Cbuf_Init (void);