#include "Cycript.tab.hh"
#include <Foundation/Foundation.h>
-#include <apr_thread_proc.h>
+#include <pthread.h>
#include <unistd.h>
#include <sstream>
CYData
{
int socket_;
- apr_thread_t *thread_;
+ pthread_t thread_;
CYClient(int socket) :
socket_(socket)
}
};
-static void * APR_THREAD_FUNC OnClient(apr_thread_t *thread, void *data) {
+static void * APR_THREAD_FUNC OnClient(void *data) {
CYClient *client(reinterpret_cast<CYClient *>(data));
client->Handle();
delete client;
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) {
#include <Pooling.hpp>
-#include <apr_thread_proc.h>
-
#include <CoreFoundation/CFLogUtilities.h>
#include <CFNetwork/CFNetwork.h>