X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=blobdiff_plain;f=src%2FClientSocket.c;h=6d2c34e5d20efe744237d1d6b3fab270a15c7607;hp=c49577724393e3de6b1443841072ff8e1ed46105;hb=2b9e305af713f0960ac0cd7645af3e0ef85a8515;hpb=740649d6f206dc1f65e7550a842cf298fac7cb36 diff --git a/src/ClientSocket.c b/src/ClientSocket.c index c495777..6d2c34e 100644 --- a/src/ClientSocket.c +++ b/src/ClientSocket.c @@ -35,7 +35,7 @@ static pthread_mutex_t synchronized; static pthread_mutex_t synchronized_recv; struct ParseOrder { - unsigned long tid; + unsigned int tid; struct ParseOrder *next; }; struct ParseOrder *parse_order = NULL; @@ -230,7 +230,7 @@ static int _connect_socket(struct ClientSocket *client) { return 1; } #else -static int connect_socket(struct ClientSocket *client) { +static int _connect_socket(struct ClientSocket *client) { if((client->flags & SOCKET_FLAG_CONNECTED)) return 1; struct hostent *host; struct sockaddr_in addr; @@ -376,7 +376,7 @@ int write_socket(struct ClientSocket *client, char* msg, int len) { } #if HAVE_THREADS -static void clientsocket_start_of_recv(unsigned long tid) { +static void clientsocket_start_of_recv(unsigned int tid) { SYNCHRONIZE(whohandler_sync); struct ParseOrder *entry, *last; for(last = parse_order; last; last = last->next) { @@ -393,7 +393,7 @@ static void clientsocket_start_of_recv(unsigned long tid) { DESYNCHRONIZE(whohandler_sync); } -static void clientsocket_end_of_recv(unsigned long tid) { +static void clientsocket_end_of_recv(unsigned int tid) { SYNCHRONIZE(whohandler_sync); struct ParseOrder *entry, *last = NULL; for(entry = parse_order; entry; entry = entry->next) { @@ -410,7 +410,7 @@ static void clientsocket_end_of_recv(unsigned long tid) { DESYNCHRONIZE(whohandler_sync); } -int clientsocket_parseorder_top(unsigned long tid) { +int clientsocket_parseorder_top(unsigned int tid) { if(parse_order && parse_order->tid == tid) return 1; else @@ -494,7 +494,7 @@ void socket_loop(int timeout_seconds) { sock->bufferpos -= used; } is_synchronized = 0; - unsigned long tid = syscall(SYS_gettid); + unsigned int tid = (unsigned int) pthread_self_tid(); clientsocket_start_of_recv(tid); DESYNCHRONIZE(synchronized_recv); parse_lines(sock, linesbuf, used);