mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-22 23:59:41 +08:00
Use semaphore/mutex insted of pipe for threads sync
This commit is contained in:
1 parent
ba2584cebf
commit
ada24a98ec
7 files changed
+29
-25
No files matched your search
+3
-3
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user