MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / thread

Class thread

3rd/asio-1.24.0/include/asio/thread.hpp:48–86  ·  view source on GitHub ↗

A simple abstraction for starting threads. * The asio::thread class implements the smallest possible subset of the * functionality of boost::thread. It is intended to be used only for starting * a thread and waiting for it to exit. If more extensive threading * capabilities are required, you are strongly advised to use something else. * * @par Thread Safety * @e Distinct @e objects: Safe.@n

Source from the content-addressed store, hash-verified

46 * t.join(); @endcode
47 */
48class thread
49 : private noncopyable
50{
51public:
52 /// Start a new thread that executes the supplied function.
53 /**
54 * This constructor creates a new thread that will execute the given function
55 * or function object.
56 *
57 * @param f The function or function object to be run in the thread. The
58 * function signature must be: @code void f(); @endcode
59 */
60 template <typename Function>
61 explicit thread(Function f)
62 : impl_(f)
63 {
64 }
65
66 /// Destructor.
67 ~thread()
68 {
69 }
70
71 /// Wait for the thread to exit.
72 /**
73 * This function will block until the thread has exited.
74 *
75 * If this function is not called before the thread object is destroyed, the
76 * thread itself will continue to run until completion. You will, however,
77 * no longer have the ability to wait for it to exit.
78 */
79 void join()
80 {
81 impl_.join();
82 }
83
84private:
85 detail::thread impl_;
86};
87
88} // namespace asio
89

Callers 6

heap_no_deleteFunction · 0.85
heap_late_freeFunction · 0.85
padding_shrinkFunction · 0.85
heap_thread_free_largeFunction · 0.85
heap_thread_free_hugeFunction · 0.85
tsan_numa_testFunction · 0.85

Calls

no outgoing calls

Tested by 6

heap_no_deleteFunction · 0.68
heap_late_freeFunction · 0.68
padding_shrinkFunction · 0.68
heap_thread_free_largeFunction · 0.68
heap_thread_free_hugeFunction · 0.68
tsan_numa_testFunction · 0.68