Removed common/thread as it is not used. Review: https://reviews.apache.org/r/36825
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/59b877f4 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/59b877f4 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/59b877f4 Branch: refs/heads/master Commit: 59b877f490ca86dd582601f848cb2b46ca204315 Parents: 16de8bd Author: Joris Van Remoortere <[email protected]> Authored: Wed Jul 29 16:25:01 2015 -0700 Committer: Benjamin Hindman <[email protected]> Committed: Wed Jul 29 16:25:01 2015 -0700 ---------------------------------------------------------------------- src/Makefile.am | 2 -- src/common/thread.cpp | 52 ---------------------------------------------- src/common/thread.hpp | 39 ---------------------------------- 3 files changed, 93 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/59b877f4/src/Makefile.am ---------------------------------------------------------------------- diff --git a/src/Makefile.am b/src/Makefile.am index 0794969..917319a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -358,7 +358,6 @@ libmesos_no_3rdparty_la_SOURCES = \ common/protobuf_utils.cpp \ common/resources.cpp \ common/resources_utils.cpp \ - common/thread.cpp \ common/type_utils.cpp \ common/values.cpp \ docker/docker.hpp \ @@ -590,7 +589,6 @@ libmesos_no_3rdparty_la_SOURCES += \ common/protobuf_utils.hpp \ common/resources_utils.hpp \ common/status_utils.hpp \ - common/thread.hpp \ credentials/credentials.hpp \ examples/test_anonymous_module.hpp \ examples/test_module.hpp \ http://git-wip-us.apache.org/repos/asf/mesos/blob/59b877f4/src/common/thread.cpp ---------------------------------------------------------------------- diff --git a/src/common/thread.cpp b/src/common/thread.cpp deleted file mode 100644 index 751e9e8..0000000 --- a/src/common/thread.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include <stout/lambda.hpp> - -#include "common/thread.hpp" - -namespace thread { - -static void* __run(void* arg) -{ - lambda::function<void(void)>* function = - reinterpret_cast<lambda::function<void(void)>*>(arg); - (*function)(); - delete function; - return 0; -} - - -bool start(const lambda::function<void(void)>& f, bool detach /*= false*/) -{ - lambda::function<void(void)>* __f = new lambda::function<void(void)>(f); - - pthread_t t; - if (pthread_create(&t, NULL, __run, __f) != 0) { - return false; - } - - if (detach && pthread_detach(t) != 0) { - return false; - } - - return true; -} - - -} // namespace thread { http://git-wip-us.apache.org/repos/asf/mesos/blob/59b877f4/src/common/thread.hpp ---------------------------------------------------------------------- diff --git a/src/common/thread.hpp b/src/common/thread.hpp deleted file mode 100644 index 9685898..0000000 --- a/src/common/thread.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __THREAD_HPP__ -#define __THREAD_HPP__ - -#include <pthread.h> - -#include <stout/lambda.hpp> - -// Provides a simple threading facility for starting a thread to run -// an arbitrary function. No mechanism for returning a value from the -// function is currently provided (and in the future would probably be -// provided by libprocess anyway). - -namespace thread { - -// TODO(benh): Provide a version of 'start' that returns a type T (the -// value being a copy or preferablly via move semantics). -bool start(const lambda::function<void(void)>& f, bool detach = false); - -} // namespace thread { - -#endif // __THREAD_HPP__
