Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1110)

Unified Diff: third_party/mojo/src/mojo/public/cpp/utility/thread.h

Issue 1410053006: Move third_party/mojo/src/mojo/public to mojo/public (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/mojo/src/mojo/public/cpp/utility/thread.h
diff --git a/third_party/mojo/src/mojo/public/cpp/utility/thread.h b/third_party/mojo/src/mojo/public/cpp/utility/thread.h
deleted file mode 100644
index d010819e2608928a640442e1d9b18e5de8b41127..0000000000000000000000000000000000000000
--- a/third_party/mojo/src/mojo/public/cpp/utility/thread.h
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef THIRD_PARTY_MOJO_SRC_MOJO_PUBLIC_CPP_UTILITY_THREAD_H_
-#define THIRD_PARTY_MOJO_SRC_MOJO_PUBLIC_CPP_UTILITY_THREAD_H_
-
-#ifdef _WIN32
-#error "Not implemented: See crbug.com/342893."
-#endif
-
-#include <pthread.h>
-#include <stddef.h>
-
-#include "third_party/mojo/src/mojo/public/cpp/system/macros.h"
-
-namespace mojo {
-
-// This class is thread-friendly, not thread-safe (e.g., you mustn't call
-// |Join()| from multiple threads and/or simultaneously try to destroy the
-// object).
-class Thread {
- public:
- // TODO(vtl): Support non-joinable? priority?
- class Options {
- public:
- Options() : stack_size_(0) {}
-
- // A stack size of 0 means the default.
- size_t stack_size() const { return stack_size_; }
- void set_stack_size(size_t stack_size) { stack_size_ = stack_size; }
-
- private:
- size_t stack_size_;
-
- // Copy and assign allowed.
- };
-
- // TODO(vtl): Add name or name prefix?
- Thread();
- explicit Thread(const Options& options);
- virtual ~Thread();
-
- void Start();
- void Join();
-
- virtual void Run() = 0;
-
- private:
- static void* ThreadRunTrampoline(void* arg);
-
- const Options options_;
- pthread_t thread_;
- bool started_;
- bool joined_;
-
- MOJO_DISALLOW_COPY_AND_ASSIGN(Thread);
-};
-
-} // namespace mojo
-
-#endif // THIRD_PARTY_MOJO_SRC_MOJO_PUBLIC_CPP_UTILITY_THREAD_H_
« no previous file with comments | « third_party/mojo/src/mojo/public/cpp/utility/tests/thread_unittest.cc ('k') | third_party/mojo/src/mojo/public/gles2/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698