From 36b9b4b39900d1b2e3b182e1b50370b0c9dcb9ae Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Tue, 24 Jun 2014 12:45:21 +0200 Subject: Change allocation of ThreadData to be physically part of the object containing it --- src/threadengines/threadengine_pthread.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/threadengines/threadengine_pthread.cpp') diff --git a/src/threadengines/threadengine_pthread.cpp b/src/threadengines/threadengine_pthread.cpp index 36ba3ab42..7900e66bc 100644 --- a/src/threadengines/threadengine_pthread.cpp +++ b/src/threadengines/threadengine_pthread.cpp @@ -39,15 +39,8 @@ static void* entry_point(void* parameter) void ThreadEngine::Start(Thread* thread) { - ThreadData* data = new ThreadData; - thread->state = data; - - if (pthread_create(&data->pthread_id, NULL, entry_point, thread) != 0) - { - thread->state = NULL; - delete data; + if (pthread_create(&thread->state.pthread_id, NULL, entry_point, thread) != 0) throw CoreException("Unable to create new thread: " + std::string(strerror(errno))); - } } void ThreadData::FreeThread(Thread* thread) -- cgit v1.3.1-10-gc9f91