1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MOJO_PUBLIC_CPP_UTILITY_THREAD_H_
6 #define MOJO_PUBLIC_CPP_UTILITY_THREAD_H_
9 #error "Not implemented: See crbug.com/342893."
15 #include "mojo/public/cpp/system/macros.h"
19 // This class is thread-friendly, not thread-safe (e.g., you mustn't call
20 // |Join()| from multiple threads and/or simultaneously try to destroy the
24 // TODO(vtl): Support non-joinable? priority?
27 Options() : stack_size_(0) {}
29 // A stack size of 0 means the default.
30 size_t stack_size() const { return stack_size_
; }
31 void set_stack_size(size_t stack_size
) { stack_size_
= stack_size
; }
36 // Copy and assign allowed.
39 // TODO(vtl): Add name or name prefix?
41 explicit Thread(const Options
& options
);
47 virtual void Run() = 0;
50 static void* ThreadRunTrampoline(void* arg
);
52 const Options options_
;
57 MOJO_DISALLOW_COPY_AND_ASSIGN(Thread
);
62 #endif // MOJO_PUBLIC_CPP_UTILITY_THREAD_H_