From 26e36b3a9d7b49d46ecfa69b447482251acba8ac Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 24 Jan 2024 16:53:38 +0300 Subject: Turn libodb repository into package for muti-package repository --- libodb/odb/details/posix/thread.ixx | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 libodb/odb/details/posix/thread.ixx (limited to 'libodb/odb/details/posix/thread.ixx') diff --git a/libodb/odb/details/posix/thread.ixx b/libodb/odb/details/posix/thread.ixx new file mode 100644 index 0000000..6576101 --- /dev/null +++ b/libodb/odb/details/posix/thread.ixx @@ -0,0 +1,29 @@ +// file : odb/details/posix/thread.ixx +// license : GNU GPL v2; see accompanying LICENSE file + +#include + +namespace odb +{ + namespace details + { + inline thread:: + ~thread () + { + if (!detached_) + pthread_detach (id_); + } + + inline void* thread:: + join () + { + void* r; + + if (int e = pthread_join (id_, &r)) + throw posix_exception (e); + + detached_ = true; + return r; + } + } +} -- cgit v1.1