Use semaphore/mutex insted of pipe for threads sync

This commit is contained in:
Vladimir Dubrovin committed 2026-04-28 14:00:15 +03:00
1 parent ba2584cebf
commit ada24a98ec
7 files changed
+29 -25

No files matched your search

+3 -3
View File
@@ -117,10 +117,10 @@ void * threadfunc (void *p) {
int pushthreadinit(){
#ifdef _WIN32
DWORD n;
return WriteFile(conf.threadinit[1], "1", 1, &n, NULL);
return ReleaseSemaphore(conf.threadinit, 1, NULL) ? 1 : 0;
#else
return write(conf.threadinit[1], "1", 1);
pthread_mutex_unlock(&conf.threadinit);
return 1;
#endif
}