goalc: some minor fixes for tests

This commit is contained in:
Tyler Wilding
2022-05-01 17:45:01 -04:00
parent 6976221c31
commit f7c30a4084
5 changed files with 5 additions and 6 deletions
-2
View File
@@ -32,9 +32,7 @@ class XSocketServer {
int listening_socket = -1;
std::vector<char> buffer;
bool kill_accept_thread = false;
bool server_initialized = false;
bool accept_thread_running = false;
bool client_connected = false;
std::function<bool()> want_exit_callback;
+2
View File
@@ -34,6 +34,8 @@ Deci2Server::~Deci2Server() {
void Deci2Server::post_init() {
fmt::print("[Deci2Server:{}] awaiting connections\n", tcp_port);
accept_thread_running = true;
kill_accept_thread = false;
accept_thread = std::thread(&Deci2Server::accept_thread_func, this);
}
+2 -1
View File
@@ -13,7 +13,6 @@ class Deci2Server : public XSocketServer {
virtual ~Deci2Server();
void post_init() override;
void pre_shutdown() override;
void read_data();
void send_data(void* buf, u16 len);
@@ -32,6 +31,8 @@ class Deci2Server : public XSocketServer {
int* d2_driver_count = nullptr;
int accepted_socket = -1;
bool kill_accept_thread = false;
bool accept_thread_running = false;
std::thread accept_thread;
std::mutex server_mutex;
-1
View File
@@ -58,7 +58,6 @@ std::optional<std::string> ReplServer::get_msg() {
auto activity = select(max_sd + 1, &read_sockets, NULL, NULL, NULL);
if (activity < 0) { // TODO - || error!
printf("Error at select(): %ld\n", WSAGetLastError());
return std::nullopt;
}
+1 -2
View File
@@ -105,8 +105,7 @@ int main(int argc, char** argv) {
auto resp = repl_server.get_msg();
if (resp) {
std::lock_guard<std::mutex> lock(compiler_mutex);
std::string copy = resp.value();
status = compiler->handle_repl_string(copy);
status = compiler->handle_repl_string(resp.value());
// Print out the prompt, just for better UX
compiler->print_to_repl(compiler->get_prompt());
}