mirror of
https://github.com/springzfx/cgproxy.git
synced 2026-03-15 09:32:09 +08:00
replace pthread with c++ thread
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#define SOCKET_SERVER_H
|
||||
|
||||
#include <functional>
|
||||
#include <future>
|
||||
#include <stdlib.h>
|
||||
#include <sys/un.h>
|
||||
using namespace std;
|
||||
@@ -14,11 +15,6 @@ namespace CGPROXY::SOCKET {
|
||||
continue; \
|
||||
}
|
||||
|
||||
struct thread_arg {
|
||||
function<int(char *)> handle_msg;
|
||||
};
|
||||
void *startThread(void *arg);
|
||||
|
||||
class SocketServer {
|
||||
public:
|
||||
int sfd = -1, cfd = -1, flag = -1;
|
||||
@@ -28,6 +24,8 @@ public:
|
||||
~SocketServer();
|
||||
};
|
||||
|
||||
void startThread(function<int(char *)> callback, promise<void> status);
|
||||
|
||||
} // namespace CGPROXY::SOCKET
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user