forked from khizmax/libcds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
urcu_sh.cpp
26 lines (20 loc) · 1008 Bytes
/
urcu_sh.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright (c) 2006-2018 Maxim Khizhinsky
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <cds/urcu/details/sh.h>
#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
namespace cds { namespace urcu { namespace details {
template<> CDS_EXPORT_API singleton_vtbl * sh_singleton_instance< signal_buffered_tag >::s_pRCU = nullptr;
template <>
void sh_singleton<signal_buffered_tag>::signal_handler( int /*signo*/, siginfo_t * /*sigInfo*/, void * /*context*/ )
{
thread_record * pRec = cds::threading::getRCU<signal_buffered_tag>();
if ( pRec ) {
atomics::atomic_signal_fence( atomics::memory_order_acquire );
pRec->m_bNeedMemBar.store( false, atomics::memory_order_relaxed );
atomics::atomic_signal_fence( atomics::memory_order_release );
}
}
}}} // namespace cds::urcu::details
#endif //#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED