Skip to content

Commit

Permalink
Swap pthread for STD thread
Browse files Browse the repository at this point in the history
  • Loading branch information
fynntimes committed Dec 26, 2020
1 parent 6db02a6 commit 39d5ea3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <mutex>
#include <thread>
#include "server.h"

std::mutex m;
Expand Down Expand Up @@ -53,7 +54,6 @@ namespace sc {
int mySocket, theirSocket;
socklen_t theirAddressSize;
int port;
pthread_t receiveThread;
Client client;
char ip[INET_ADDRSTRLEN];

Expand Down Expand Up @@ -96,7 +96,7 @@ namespace sc {
auto params = new ReceiveParams;
params->server = this;
params->socket = &client;
pthread_create(&receiveThread, nullptr, Server::receiveMessageHelper, params);
std::thread receiver(Server::receiveMessageHelper, params);
m.unlock();
}
}
Expand Down

0 comments on commit 39d5ea3

Please sign in to comment.