You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Started with tty_Hide. Easy enough. Clearly a race. Tho looks like it would only result in incorrect tty output. Still, how to solve?
I looked through the code for a mutex primitive. Only found Sys_EnterCriticalSection and Sys_LeaveCriticalSection. No idea what to provide for the critical section index. add a new one?
Attempt using CRITICAL_SECTION_TWO as it looked unused:
diff --git a/neo/sys/posix/posix_main.cpp b/neo/sys/posix/posix_main.cpp
index 80b7745..0e239df 100644
--- a/neo/sys/posix/posix_main.cpp
+++ b/neo/sys/posix/posix_main.cpp
@@ -560,8 +560,10 @@ void tty_Hide() {
if ( !tty_enabled ) {
return;
}
+ Sys_EnterCriticalSection(CRITICAL_SECTION_TWO);
if ( input_hide ) {
input_hide++;
+ Sys_LeaveCriticalSection(CRITICAL_SECTION_TWO);
return;
}
// clear after cursor
@@ -576,6 +578,7 @@ void tty_Hide() {
buf_len--;
}
input_hide++;
+ Sys_LeaveCriticalSection(CRITICAL_SECTION_TWO);
}
// show the current line
ThreadSanitizer report:
The text was updated successfully, but these errors were encountered: