diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-02-11 12:14:00 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-02-11 12:14:00 (GMT) |
commit | 0efa7c32aaf21a29b42b5926cc116007056843be (patch) | |
tree | 882f663a5dd0e65694bf6077b71086dd77fd7ff8 /3rdParty/Boost/boost/thread/win32/thread_data.hpp | |
parent | 1d20eabbc32274b491b4c2bedf73d19933d97bfd (diff) | |
download | swift-contrib-0efa7c32aaf21a29b42b5926cc116007056843be.zip swift-contrib-0efa7c32aaf21a29b42b5926cc116007056843be.tar.bz2 |
Moved some modules into separate git modules.
Diffstat (limited to '3rdParty/Boost/boost/thread/win32/thread_data.hpp')
m--------- | 3rdParty/Boost | 0 | ||||
-rw-r--r-- | 3rdParty/Boost/boost/thread/win32/thread_data.hpp | 178 |
2 files changed, 0 insertions, 178 deletions
diff --git a/3rdParty/Boost b/3rdParty/Boost new file mode 160000 +Subproject 3bbdbc8cf1996f23d9a366da8bac0f97be6ad79 diff --git a/3rdParty/Boost/boost/thread/win32/thread_data.hpp b/3rdParty/Boost/boost/thread/win32/thread_data.hpp deleted file mode 100644 index 1a6a1e0..0000000 --- a/3rdParty/Boost/boost/thread/win32/thread_data.hpp +++ /dev/null @@ -1,178 +0,0 @@ -#ifndef BOOST_THREAD_PTHREAD_THREAD_DATA_HPP -#define BOOST_THREAD_PTHREAD_THREAD_DATA_HPP -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// (C) Copyright 2008 Anthony Williams - -#include <boost/thread/detail/config.hpp> -#include <boost/intrusive_ptr.hpp> -#include <boost/thread/thread_time.hpp> -#include "thread_primitives.hpp" -#include "thread_heap_alloc.hpp" - -#include <boost/config/abi_prefix.hpp> - -namespace boost -{ - namespace detail - { - struct thread_exit_callback_node; - struct tss_data_node; - - struct thread_data_base; - void intrusive_ptr_add_ref(thread_data_base * p); - void intrusive_ptr_release(thread_data_base * p); - - struct thread_data_base - { - long count; - detail::win32::handle_manager thread_handle; - detail::win32::handle_manager interruption_handle; - boost::detail::thread_exit_callback_node* thread_exit_callbacks; - boost::detail::tss_data_node* tss_data; - bool interruption_enabled; - unsigned id; - - thread_data_base(): - count(0),thread_handle(detail::win32::invalid_handle_value), - interruption_handle(create_anonymous_event(detail::win32::manual_reset_event,detail::win32::event_initially_reset)), - thread_exit_callbacks(0),tss_data(0), - interruption_enabled(true), - id(0) - {} - virtual ~thread_data_base() - {} - - friend void intrusive_ptr_add_ref(thread_data_base * p) - { - BOOST_INTERLOCKED_INCREMENT(&p->count); - } - - friend void intrusive_ptr_release(thread_data_base * p) - { - if(!BOOST_INTERLOCKED_DECREMENT(&p->count)) - { - detail::heap_delete(p); - } - } - - void interrupt() - { - BOOST_VERIFY(detail::win32::SetEvent(interruption_handle)!=0); - } - - typedef detail::win32::handle native_handle_type; - - virtual void run()=0; - }; - - typedef boost::intrusive_ptr<detail::thread_data_base> thread_data_ptr; - - struct timeout - { - unsigned long start; - uintmax_t milliseconds; - bool relative; - boost::system_time abs_time; - - static unsigned long const max_non_infinite_wait=0xfffffffe; - - timeout(uintmax_t milliseconds_): - start(win32::GetTickCount()), - milliseconds(milliseconds_), - relative(true), - abs_time(boost::get_system_time()) - {} - - timeout(boost::system_time const& abs_time_): - start(win32::GetTickCount()), - milliseconds(0), - relative(false), - abs_time(abs_time_) - {} - - struct remaining_time - { - bool more; - unsigned long milliseconds; - - remaining_time(uintmax_t remaining): - more(remaining>max_non_infinite_wait), - milliseconds(more?max_non_infinite_wait:(unsigned long)remaining) - {} - }; - - remaining_time remaining_milliseconds() const - { - if(is_sentinel()) - { - return remaining_time(win32::infinite); - } - else if(relative) - { - unsigned long const now=win32::GetTickCount(); - unsigned long const elapsed=now-start; - return remaining_time((elapsed<milliseconds)?(milliseconds-elapsed):0); - } - else - { - system_time const now=get_system_time(); - if(abs_time<=now) - { - return remaining_time(0); - } - return remaining_time((abs_time-now).total_milliseconds()+1); - } - } - - bool is_sentinel() const - { - return milliseconds==~uintmax_t(0); - } - - - static timeout sentinel() - { - return timeout(sentinel_type()); - } - private: - struct sentinel_type - {}; - - explicit timeout(sentinel_type): - start(0),milliseconds(~uintmax_t(0)),relative(true) - {} - }; - } - - namespace this_thread - { - void BOOST_THREAD_DECL yield(); - - bool BOOST_THREAD_DECL interruptible_wait(detail::win32::handle handle_to_wait_for,detail::timeout target_time); - inline void interruptible_wait(unsigned long milliseconds) - { - interruptible_wait(detail::win32::invalid_handle_value,milliseconds); - } - inline void interruptible_wait(system_time const& abs_time) - { - interruptible_wait(detail::win32::invalid_handle_value,abs_time); - } - - template<typename TimeDuration> - inline void sleep(TimeDuration const& rel_time) - { - interruptible_wait(static_cast<unsigned long>(rel_time.total_milliseconds())); - } - inline void sleep(system_time const& abs_time) - { - interruptible_wait(abs_time); - } - } - -} - -#include <boost/config/abi_suffix.hpp> - -#endif |