thread.h
Go to the documentation of this file.
00001 // 
00002 // Copyright (c) 2010-2012, Benjamin Kaufmann
00003 // 
00004 // This file is part of Clasp. See http://www.cs.uni-potsdam.de/clasp/ 
00005 // 
00006 // Clasp is free software; you can redistribute it and/or modify
00007 // it under the terms of the GNU General Public License as published by
00008 // the Free Software Foundation; either version 2 of the License, or
00009 // (at your option) any later version.
00010 // 
00011 // Clasp is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 // GNU General Public License for more details.
00015 // 
00016 // You should have received a copy of the GNU General Public License
00017 // along with Clasp; if not, write to the Free Software
00018 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00019 //
00020 
00021 #ifndef CLASP_UTIL_THREAD_H_INCLUDED
00022 #define CLASP_UTIL_THREAD_H_INCLUDED
00023 
00024 #if WITH_THREADS
00025 #if _WIN32||_WIN64
00026 #define WIN32_LEAN_AND_MEAN // exclude APIs such as Cryptography, DDE, RPC, Shell, and Windows Sockets.
00027 #define NOMINMAX            // do not let windows.h define macros min and max
00028 #endif
00029 #include <tbb/tbb_thread.h>
00030 namespace Clasp {
00031         typedef tbb::tbb_thread thread;
00032         namespace this_thread {
00033                 using tbb::this_tbb_thread::yield;
00034         }
00035 }
00036 #else
00037 namespace no_multi_threading {
00038         struct thread {};
00039         inline void yield() {}
00040 }
00041 namespace Clasp { 
00042         typedef no_multi_threading::thread thread;
00043         namespace this_thread { using no_multi_threading::yield; }
00044 }
00045 #endif
00046 
00047 #endif


clasp
Author(s): Benjamin Kaufmann
autogenerated on Thu Aug 27 2015 12:41:40