11 * WARNING: This class is DEPRECATED. New code should use std::thread directly
13 * ndb_thread: threads in NuDB
15 * Note that ndb_threads are thin wrappers around std::thread.
17 * There is really no point to use this-- in the past we used this to grab
18 * hooks into threads when they exited. This is no longer necessary, so we
19 * removed the hook code and this exists just for legacy reasons.
25 typedef void (*run_t)(void);
27 ndb_thread(bool daemon = false, const std::string &name = "thd")
28 : body_(nullptr), daemon_(daemon), name_(name) {}
29 ndb_thread(run_t body, bool daemon = false, const std::string &name = "thd")
30 : body_(body), daemon_(daemon), name_(name) {}
32 ndb_thread(const ndb_thread &) = delete;
33 ndb_thread(ndb_thread &&) = delete;
34 ndb_thread &operator=(const ndb_thread &) = delete;
36 virtual ~ndb_thread();
38 inline const std::string &
52 const std::string name_;
55 #endif /* _NDB_THREAD_H_ */