mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-27 11:40:52 +00:00
Get rid of mutexes on command buffer
This commit is contained in:
parent
8367a8553c
commit
b6188a3b16
1 changed files with 0 additions and 23 deletions
|
@ -37,17 +37,6 @@
|
|||
#include "d_netfil.h" // findfile
|
||||
#include "d_async.h"
|
||||
#include "filesrch.h"
|
||||
#include "i_threads.h"
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
static I_mutex com_text_mutex;
|
||||
|
||||
# define Lock_state() I_lock_mutex(&com_text_mutex)
|
||||
# define Unlock_state() I_unlock_mutex(com_text_mutex)
|
||||
#else/*HAVE_THREADS*/
|
||||
# define Lock_state()
|
||||
# define Unlock_state()
|
||||
#endif/*HAVE_THREADS*/
|
||||
|
||||
//========
|
||||
// protos.
|
||||
|
@ -133,14 +122,10 @@ void COM_BufAddText(const char *ptext)
|
|||
|
||||
l = strlen(ptext);
|
||||
|
||||
Lock_state();
|
||||
|
||||
if (com_text.cursize + l >= com_text.maxsize)
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Command buffer full!\n"));
|
||||
else
|
||||
VS_Write(&com_text, ptext, l);
|
||||
|
||||
Unlock_state();
|
||||
}
|
||||
|
||||
/** Adds command text and executes it immediately.
|
||||
|
@ -153,8 +138,6 @@ void COM_BufInsertText(const char *ptext)
|
|||
char *temp = NULL;
|
||||
size_t templen;
|
||||
|
||||
Lock_state();
|
||||
|
||||
// copy off any commands still remaining in the exec buffer
|
||||
templen = com_text.cursize;
|
||||
if (templen)
|
||||
|
@ -173,8 +156,6 @@ void COM_BufInsertText(const char *ptext)
|
|||
VS_Write(&com_text, temp, templen);
|
||||
Z_Free(temp);
|
||||
}
|
||||
|
||||
Unlock_state();
|
||||
}
|
||||
|
||||
/** Progress the wait timer and flush waiting console commands when ready.
|
||||
|
@ -200,8 +181,6 @@ void COM_BufExecute(void)
|
|||
char line[1024] = "";
|
||||
INT32 quotes;
|
||||
|
||||
Lock_state();
|
||||
|
||||
while (com_text.cursize)
|
||||
{
|
||||
// find a '\n' or; line break
|
||||
|
@ -249,8 +228,6 @@ void COM_BufExecute(void)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Unlock_state();
|
||||
}
|
||||
|
||||
/** Executes a string immediately. Used for skirting around WAIT commands.
|
||||
|
|
Loading…
Reference in a new issue