From 1f9f0ef73f69d9389bc70a8eff0cb3a8926903ad Mon Sep 17 00:00:00 2001 From: hyc Date: Thu, 31 Dec 2009 04:10:30 +0000 Subject: [PATCH] More thread cleanup git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@155 400ebc74-4327-4243-bc38-086b20814532 --- rtmpsrv.c | 5 +++-- rtmpsuck.c | 5 +++-- streams.c | 5 +++-- thread.h | 1 + 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/rtmpsrv.c b/rtmpsrv.c index 9451373..ccb9e2f 100644 --- a/rtmpsrv.c +++ b/rtmpsrv.c @@ -530,8 +530,9 @@ quit: } TFTYPE -serverThread(STREAMING_SERVER * server) +serverThread(void *arg) { + STREAMING_SERVER *server = arg; server->state = STREAMING_ACCEPTING; while (server->state == STREAMING_ACCEPTING) @@ -604,7 +605,7 @@ startStreaming(const char *address, int port) server = (STREAMING_SERVER *) calloc(1, sizeof(STREAMING_SERVER)); server->socket = sockfd; - ThreadCreate((thrfunc *)serverThread, server); + ThreadCreate(serverThread, server); return server; } diff --git a/rtmpsuck.c b/rtmpsuck.c index 3b87e32..7aad6f0 100644 --- a/rtmpsuck.c +++ b/rtmpsuck.c @@ -872,8 +872,9 @@ quit: } TFTYPE -serverThread(STREAMING_SERVER * server) +serverThread(void *arg) { + STREAMING_SERVER *server = arg; server->state = STREAMING_ACCEPTING; while (server->state == STREAMING_ACCEPTING) @@ -950,7 +951,7 @@ startStreaming(const char *address, int port) server = (STREAMING_SERVER *) calloc(1, sizeof(STREAMING_SERVER)); server->socket = sockfd; - ThreadCreate((thrfunc *)serverThread, server); + ThreadCreate(serverThread, server); return server; } diff --git a/streams.c b/streams.c index bcff29c..1988b96 100644 --- a/streams.c +++ b/streams.c @@ -761,8 +761,9 @@ filenotfound: } TFTYPE -serverThread(STREAMING_SERVER * server) +serverThread(void *arg) { + STREAMING_SERVER *server = arg; server->state = STREAMING_ACCEPTING; while (server->state == STREAMING_ACCEPTING) @@ -825,7 +826,7 @@ startStreaming(const char *address, int port) server = (STREAMING_SERVER *) calloc(1, sizeof(STREAMING_SERVER)); server->socket = sockfd; - ThreadCreate((void *(*)(void *)) serverThread, server); + ThreadCreate(serverThread, server); return server; } diff --git a/thread.h b/thread.h index f638661..76d30ee 100644 --- a/thread.h +++ b/thread.h @@ -22,6 +22,7 @@ #define __THREAD_H__ 1 #ifdef WIN32 +#include #include #define TFTYPE void #define TFRET() -- 2.40.0