diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 32b1e30f8..f71bd9f5e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -12,15 +12,15 @@ set (task_SRCS API.cpp API.h Att.cpp Att.h Cmd.cpp Cmd.h Color.cpp Color.h Nibbler.cpp Nibbler.h Path.cpp Path.h Permission.cpp Permission.h Record.cpp Record.h Rectangle.cpp Rectangle.h Sequence.cpp Sequence.h Subst.cpp Subst.h TDB.cpp TDB.h Table.cpp TDB2.cpp - TDB2.h Table.h Task.cpp Task.h Taskmod.cpp Taskmod.h Thread.cpp - Thread.h Timer.cpp Timer.h Transport.cpp Transport.h - TransportSSH.cpp TransportSSH.h TransportRSYNC.cpp - TransportRSYNC.h TransportCurl.cpp TransportCurl.h Tree.cpp - Tree.h burndown.cpp command.cpp custom.cpp dependency.cpp - diag.cpp edit.cpp export.cpp history.cpp i18n.h import.cpp - interactive.cpp recur.cpp report.cpp rules.cpp rx.cpp rx.h - text.cpp text.h utf8.cpp utf8.h util.cpp util.h Uri.cpp Uri.h - Variant.cpp Variant.h View.cpp View.h) + TDB2.h Table.h Task.cpp Task.h Taskmod.cpp Taskmod.h Timer.cpp + Timer.h Transport.cpp Transport.h TransportSSH.cpp TransportSSH.h + TransportRSYNC.cpp TransportRSYNC.h TransportCurl.cpp + TransportCurl.h Tree.cpp Tree.h burndown.cpp command.cpp + custom.cpp dependency.cpp diag.cpp edit.cpp export.cpp + history.cpp i18n.h import.cpp interactive.cpp recur.cpp + report.cpp rules.cpp rx.cpp rx.h text.cpp text.h utf8.cpp utf8.h + util.cpp util.h Uri.cpp Uri.h Variant.cpp Variant.h View.cpp + View.h) add_library (task STATIC ${task_SRCS}) add_executable (task_executable main.cpp) diff --git a/src/Thread.cpp b/src/Thread.cpp deleted file mode 100644 index c2e79884f..000000000 --- a/src/Thread.cpp +++ /dev/null @@ -1,89 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// taskwarrior - a command line task list manager. -// -// Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez. -// All rights reserved. -// -// This program is free software; you can redistribute it and/or modify it under -// the terms of the GNU General Public License as published by the Free Software -// Foundation; either version 2 of the License, or (at your option) any later -// version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -// details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the -// -// Free Software Foundation, Inc., -// 51 Franklin Street, Fifth Floor, -// Boston, MA -// 02110-1301 -// USA -// -//////////////////////////////////////////////////////////////////////////////// -#include -#include - -//////////////////////////////////////////////////////////////////////////////// -Thread::Thread () -{ -} - -//////////////////////////////////////////////////////////////////////////////// -Thread::~Thread () -{ -} - -//////////////////////////////////////////////////////////////////////////////// -int Thread::start (void* inArg) -{ -#ifdef HAVE_LIBPTHREAD - mArg = inArg; - return pthread_create (&mTID, NULL, (void*(*)(void*)) Thread::entryPoint, (void*) this); -#else - return 0; -#endif -} - -//////////////////////////////////////////////////////////////////////////////// -void Thread::wait () -{ -#ifdef HAVE_LIBPTHREAD - pthread_join (mTID, NULL); -#endif -} - -//////////////////////////////////////////////////////////////////////////////// -void Thread::cancel () -{ -#ifdef HAVE_LIBPTHREAD - pthread_cancel (mTID); -#endif -} - -//////////////////////////////////////////////////////////////////////////////// -void Thread::detach () -{ -#ifdef HAVE_LIBPTHREAD - pthread_detach (mTID); -#endif -} - -//////////////////////////////////////////////////////////////////////////////// -void* Thread::entryPoint (void* inThis) -{ - Thread* p = (Thread*) inThis; - p->execute (p->arg ()); - return NULL; -} - -//////////////////////////////////////////////////////////////////////////////// -void* Thread::arg () -{ - return mArg; -} - -//////////////////////////////////////////////////////////////////////////////// diff --git a/src/Thread.h b/src/Thread.h deleted file mode 100644 index 19ad4e9ee..000000000 --- a/src/Thread.h +++ /dev/null @@ -1,58 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// taskwarrior - a command line task list manager. -// -// Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez. -// All rights reserved. -// -// This program is free software; you can redistribute it and/or modify it under -// the terms of the GNU General Public License as published by the Free Software -// Foundation; either version 2 of the License, or (at your option) any later -// version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -// details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the -// -// Free Software Foundation, Inc., -// 51 Franklin Street, Fifth Floor, -// Boston, MA -// 02110-1301 -// USA -// -//////////////////////////////////////////////////////////////////////////////// -#ifndef INCLUDED_THREAD -#define INCLUDED_THREAD - -#include <../cmake.h> - -#ifdef HAVE_LIBPTHREAD -#include -#endif - -class Thread -{ -public: - Thread (); - virtual ~Thread (); - int start (void* arg); - void wait (); - void cancel (); - void detach (); - void* arg (); - -protected: - static void* entryPoint (void*); - virtual void execute (void*) = 0; - -private: - pthread_t mTID; - void* mArg; -}; - -#endif - -////////////////////////////////////////////////////////////////////////////////