Hackfut Security File Manager
Current Path:
/usr/include/c++/4.4.4
usr
/
include
/
c++
/
4.4.4
/
📁
..
📄
algorithm
(2.47 KB)
📄
array
(1.82 KB)
📁
backward
📁
bits
📄
bitset
(37.35 KB)
📄
c++0x_warning.h
(1.41 KB)
📄
cassert
(1.65 KB)
📄
ccomplex
(1.39 KB)
📄
cctype
(2.79 KB)
📄
cerrno
(1.77 KB)
📄
cfenv
(1.83 KB)
📄
cfloat
(2 KB)
📄
chrono
(20.63 KB)
📄
cinttypes
(2.1 KB)
📄
ciso646
(1.48 KB)
📄
climits
(1.91 KB)
📄
clocale
(1.95 KB)
📄
cmath
(15.2 KB)
📄
complex
(41.27 KB)
📄
complex.h
(1.34 KB)
📄
condition_variable
(6.06 KB)
📄
csetjmp
(1.99 KB)
📄
csignal
(1.9 KB)
📄
cstdarg
(1.89 KB)
📄
cstdatomic
(23.77 KB)
📄
cstdbool
(1.38 KB)
📄
cstddef
(1.79 KB)
📄
cstdint
(2.32 KB)
📄
cstdio
(4.7 KB)
📄
cstdlib
(5.59 KB)
📄
cstring
(3.18 KB)
📄
ctgmath
(1.3 KB)
📄
ctime
(2.16 KB)
📄
cwchar
(6.38 KB)
📄
cwctype
(3.22 KB)
📄
cxxabi-forced.h
(1.59 KB)
📄
cxxabi.h
(18.66 KB)
📁
debug
📄
deque
(2.6 KB)
📄
exception
(4.74 KB)
📄
exception_defines.h
(1.61 KB)
📄
exception_ptr.h
(4.25 KB)
📁
ext
📄
fenv.h
(1.84 KB)
📄
forward_list
(1.45 KB)
📄
fstream
(28.58 KB)
📄
functional
(2.6 KB)
📄
initializer_list
(1.94 KB)
📄
iomanip
(8.49 KB)
📄
ios
(1.62 KB)
📄
iosfwd
(5.88 KB)
📄
iostream
(2.59 KB)
📄
istream
(27.64 KB)
📄
iterator
(2.58 KB)
📄
limits
(44.45 KB)
📄
list
(2.53 KB)
📄
locale
(1.45 KB)
📄
map
(2.42 KB)
📄
memory
(3.28 KB)
📄
mutex
(17.95 KB)
📄
new
(3.65 KB)
📄
numeric
(2.74 KB)
📄
ostream
(18.01 KB)
📁
parallel
📄
queue
(2.45 KB)
📄
random
(2.04 KB)
📄
ratio
(8.96 KB)
📄
regex
(1.96 KB)
📄
set
(2.42 KB)
📄
sstream
(18.43 KB)
📄
stack
(2.37 KB)
📄
stdatomic.h
(7.09 KB)
📄
stdexcept
(4.15 KB)
📄
streambuf
(27.45 KB)
📄
string
(1.97 KB)
📄
system_error
(9.21 KB)
📄
tgmath.h
(1.34 KB)
📄
thread
(6.41 KB)
📁
tr1
📁
tr1_impl
📄
tuple
(20.57 KB)
📄
type_traits
(16.75 KB)
📄
typeinfo
(7 KB)
📄
unordered_map
(2.39 KB)
📄
unordered_set
(2.39 KB)
📄
utility
(3.24 KB)
📄
valarray
(35.63 KB)
📄
vector
(2.63 KB)
📁
x86_64-redhat-linux
Editing: condition_variable
// <condition_variable> -*- C++ -*- // Copyright (C) 2008, 2009 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. /** @file condition_variable * This is a Standard C++ Library header. */ #ifndef _GLIBCXX_CONDITION_VARIABLE #define _GLIBCXX_CONDITION_VARIABLE 1 #pragma GCC system_header #ifndef __GXX_EXPERIMENTAL_CXX0X__ # include <c++0x_warning.h> #else #include <chrono> #include <mutex> // unique_lock #if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) namespace std { /** * @defgroup condition_variables Condition Variables * @ingroup concurrency * * Classes for condition_variable support. * @{ */ /// condition_variable class condition_variable { typedef chrono::system_clock __clock_t; typedef __gthread_cond_t __native_type; __native_type _M_cond; public: typedef __native_type* native_handle_type; condition_variable(); ~condition_variable(); condition_variable(const condition_variable&) = delete; condition_variable& operator=(const condition_variable&) = delete; void notify_one(); void notify_all(); void wait(unique_lock<mutex>& __lock); template<typename _Predicate> void wait(unique_lock<mutex>& __lock, _Predicate __p) { while (!__p()) wait(__lock); } template<typename _Duration> bool wait_until(unique_lock<mutex>& __lock, const chrono::time_point<__clock_t, _Duration>& __atime) { return __wait_until_impl(__lock, __atime); } template<typename _Clock, typename _Duration> bool wait_until(unique_lock<mutex>& __lock, const chrono::time_point<_Clock, _Duration>& __atime) { // DR 887 - Sync unknown clock to known clock. typename _Clock::time_point __c_entry = _Clock::now(); __clock_t::time_point __s_entry = __clock_t::now(); chrono::nanoseconds __delta = __atime - __c_entry; __clock_t::time_point __s_atime = __s_entry + __delta; return __wait_until_impl(__lock, __s_atime); } template<typename _Clock, typename _Duration, typename _Predicate> bool wait_until(unique_lock<mutex>& __lock, const chrono::time_point<_Clock, _Duration>& __atime, _Predicate __p) { while (!__p()) if (!wait_until(__lock, __atime)) return __p(); return true; } template<typename _Rep, typename _Period> bool wait_for(unique_lock<mutex>& __lock, const chrono::duration<_Rep, _Period>& __rtime) { return wait_until(__lock, __clock_t::now() + __rtime); } template<typename _Rep, typename _Period, typename _Predicate> bool wait_for(unique_lock<mutex>& __lock, const chrono::duration<_Rep, _Period>& __rtime, _Predicate __p) { return wait_until(__lock, __clock_t::now() + __rtime, std::move(__p)); } native_handle_type native_handle() { return &_M_cond; } private: template<typename _Clock, typename _Duration> bool __wait_until_impl(unique_lock<mutex>& __lock, const chrono::time_point<_Clock, _Duration>& __atime) { chrono::time_point<__clock_t, chrono::seconds> __s = chrono::time_point_cast<chrono::seconds>(__atime); chrono::nanoseconds __ns = chrono::duration_cast<chrono::nanoseconds>(__atime - __s); __gthread_time_t __ts = { static_cast<std::time_t>(__s.time_since_epoch().count()), static_cast<long>(__ns.count()) }; __gthread_cond_timedwait(&_M_cond, __lock.mutex()->native_handle(), &__ts); return _Clock::now() < __atime; } }; /// condition_variable_any // Like above, only mutex may not have try_lock. class condition_variable_any { typedef __gthread_cond_t __native_type; __native_type _M_cond; public: typedef __native_type* native_handle_type; condition_variable_any(); ~condition_variable_any(); condition_variable_any(const condition_variable_any&) = delete; condition_variable_any& operator=(const condition_variable_any&) = delete; void notify_one(); void notify_all(); template<typename _Lock> void wait(_Lock& __lock); template<typename _Lock, typename _Predicate> void wait(_Lock& __lock, _Predicate __p); template<typename _Lock, typename _Clock, typename _Duration> bool wait_until(_Lock& __lock, const chrono::time_point<_Clock, _Duration>& __atime); template<typename _Lock, typename _Clock, typename _Duration, typename _Predicate> bool wait_until(_Lock& __lock, const chrono::time_point<_Clock, _Duration>& __atime, _Predicate __p); template<typename _Lock, typename _Rep, typename _Period> bool wait_for(_Lock& __lock, const chrono::duration<_Rep, _Period>& __rtime); template<typename _Lock, typename _Rep, typename _Period, typename _Predicate> bool wait_for(_Lock& __lock, const chrono::duration<_Rep, _Period>& __rtime, _Predicate __p); native_handle_type native_handle() { return &_M_cond; } }; // @} group condition_variables } #endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1 #endif // __GXX_EXPERIMENTAL_CXX0X__ #endif // _GLIBCXX_CONDITION_VARIABLE
Upload File
Create Folder