From acb656e605d91971ee4014da66be1b7ba6201ac3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 18 Aug 2010 17:51:09 +0200 Subject: Add multi-threading primitives Currently only the pthread-based implementation is present. --- odb/details/posix/thread.hxx | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 odb/details/posix/thread.hxx (limited to 'odb/details/posix/thread.hxx') diff --git a/odb/details/posix/thread.hxx b/odb/details/posix/thread.hxx new file mode 100644 index 0000000..5036b37 --- /dev/null +++ b/odb/details/posix/thread.hxx @@ -0,0 +1,37 @@ +// file : odb/details/posix/thread.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_DETAILS_POSIX_THREAD_HXX +#define ODB_DETAILS_POSIX_THREAD_HXX + +#include + +namespace odb +{ + namespace details + { + class thread + { + public: + ~thread (); + thread (void* (*thread_func) (void*), void* arg = 0); + + void* + join (); + + private: + thread (const thread&); + thread& operator= (const thread&); + + private: + bool detached_; + pthread_t id_; + }; + } +} + +#include + +#endif // ODB_DETAILS_POSIX_THREAD_HXX -- cgit v1.1