wm: glendy

Download patch

ref: d60b119559e63594d7cfcaf10f2db3ab068f19c9
parent: f5117aa561603b1dea42afcf503392f4a56417ca
author: mkf <mkf@cloud9p.org>
date: Wed Jun 5 16:30:15 EDT 2024

lock before changing clients quene

--- a/srv5.c
+++ b/srv5.c
@@ -665,19 +665,14 @@
 	cl = newclient(s, fd);
 	
 	if(cl != nil)
+	{
+		pthread_mutex_lock(&game_lock);
 		makematch(cl);
-
+		pthread_mutex_unlock(&game_lock);
+	}
 	die:
 		free(s);
 }
-
-/*
-static pthread_t*
-newthread(void)
-{
-	return (pthread_t*)emalloc(sizeof(pthread_t));
-}
-*/
 
 void
 srv(int listenfd)