From: Jay Freeman (saurik) Date: Fri, 21 Jun 2013 22:14:09 +0000 (-0700) Subject: Replace only apr_thread_create with pthread_create. X-Git-Tag: v0.9.500%b1~60 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/63129b670567a8b5c6d4330b60481ca6d332f732 Replace only apr_thread_create with pthread_create. --- diff --git a/Handler.mm b/Handler.mm index e460483..c289c4e 100644 --- a/Handler.mm +++ b/Handler.mm @@ -28,7 +28,7 @@ #include "Cycript.tab.hh" #include -#include +#include #include #include @@ -65,7 +65,7 @@ struct CYClient : CYData { int socket_; - apr_thread_t *thread_; + pthread_t thread_; CYClient(int socket) : socket_(socket) @@ -141,7 +141,7 @@ struct CYClient : } }; -static void * APR_THREAD_FUNC OnClient(apr_thread_t *thread, void *data) { +static void * APR_THREAD_FUNC OnClient(void *data) { CYClient *client(reinterpret_cast(data)); client->Handle(); delete client; @@ -150,9 +150,7 @@ static void * APR_THREAD_FUNC OnClient(apr_thread_t *thread, void *data) { extern "C" void CYHandleClient(CYPool &pool, int socket) { CYClient *client(new(pool) CYClient(socket)); - apr_threadattr_t *attr; - _aprcall(apr_threadattr_create(&attr, *client->pool_)); - _aprcall(apr_thread_create(&client->thread_, attr, &OnClient, client, *client->pool_)); + _assert(pthread_create(&client->thread_, NULL, &OnClient, client) == 0); } extern "C" void CYHandleServer(pid_t pid) { diff --git a/Server.cpp b/Server.cpp index 7a6bed7..7b88f97 100644 --- a/Server.cpp +++ b/Server.cpp @@ -21,8 +21,6 @@ #include -#include - #include #include