#include <XrdClStream.hh>
Classes | |
| struct | MtxInfo |
Public Member Functions | |
| StreamMutex () | |
| ~StreamMutex () | |
| void | AddClosing (uint16_t subStream) |
| AddClosing. Notified that subStream will be closed. | |
| void | Lock () |
| Lock. Regular, non-subStream aware recursive lock. | |
| void | Lock (const std::function< void()> &func, bool &isclosing) |
| void | Lock (uint16_t subStream, bool &isclosing) |
| Lock. subStream number aware with the potential to abort. | |
| void | RemoveClosing (uint16_t subStream) |
| RemoveClosing. Notified that subStream close has completed. | |
| void | UnLock () |
| UnLock. | |
Public Attributes | |
| std::list< MtxInfo >::iterator | fnlistit |
| bool | hasfn |
| std::map< uint16_t, size_t > | mclosing |
| XrdSysCondVar | mcv |
| std::list< MtxInfo > | mlist |
| std::map< pthread_t, std::list< MtxInfo >::iterator > | mthmap |
Mutex for the main Stream mutex. In the usual case acts as a recursive mutex. But supports an awareness of subStream number. In case an AsyncSocketHandler needs to be Close() any Poller callback must for the handler must complete. (Unless the close is executed within the callback thread). Thus this mutex allows aborting an acquisition attempt when the lock has been declared to be within a subStream callback and when Mutex is notified of an intent to Close that subStream.
Definition at line 61 of file XrdClStream.hh.
|
inline |
Definition at line 64 of file XrdClStream.hh.
|
inline |
Definition at line 65 of file XrdClStream.hh.
| void XrdCl::StreamMutex::AddClosing | ( | uint16_t | subStream | ) |
| void XrdCl::StreamMutex::Lock | ( | ) |
Lock. Regular, non-subStream aware recursive lock.
Definition at line 119 of file XrdClStream.cc.
References XrdSysThread::ID(), mcv, mlist, and mthmap.
| void XrdCl::StreamMutex::Lock | ( | const std::function< void()> & | func, |
| bool & | isclosing ) |
Lock. Locks or otherwise returns immedately, while the Mutex will abort all waiting subStream acquisitions and execute supplied func when lock is released. Lock will be atomically acquired at last release. Only one func may be registered at a time.
Definition at line 195 of file XrdClStream.cc.
References fnlistit, hasfn, XrdSysThread::ID(), mcv, mlist, and mthmap.
| void XrdCl::StreamMutex::Lock | ( | uint16_t | subStream, |
| bool & | isclosing ) |
Lock. subStream number aware with the potential to abort.
Definition at line 152 of file XrdClStream.cc.
References hasfn, XrdSysThread::ID(), mclosing, mcv, mlist, and mthmap.
| void XrdCl::StreamMutex::RemoveClosing | ( | uint16_t | subStream | ) |
| void XrdCl::StreamMutex::UnLock | ( | ) |
UnLock.
Definition at line 238 of file XrdClStream.cc.
References fnlistit, hasfn, XrdSysThread::ID(), mcv, mlist, mthmap, UnLock(), and XrdSysCondVarHelper::UnLock().
Referenced by UnLock().
| std::list<MtxInfo>::iterator XrdCl::StreamMutex::fnlistit |
Definition at line 121 of file XrdClStream.hh.
| bool XrdCl::StreamMutex::hasfn |
Definition at line 120 of file XrdClStream.hh.
Referenced by StreamMutex(), ~StreamMutex(), Lock(), Lock(), and UnLock().
| std::map<uint16_t, size_t> XrdCl::StreamMutex::mclosing |
Definition at line 118 of file XrdClStream.hh.
Referenced by ~StreamMutex(), AddClosing(), Lock(), and RemoveClosing().
| XrdSysCondVar XrdCl::StreamMutex::mcv |
Definition at line 116 of file XrdClStream.hh.
Referenced by StreamMutex(), AddClosing(), Lock(), Lock(), Lock(), RemoveClosing(), and UnLock().
| std::list<MtxInfo> XrdCl::StreamMutex::mlist |
Definition at line 117 of file XrdClStream.hh.
Referenced by ~StreamMutex(), Lock(), Lock(), Lock(), and UnLock().
| std::map<pthread_t, std::list<MtxInfo>::iterator> XrdCl::StreamMutex::mthmap |
Definition at line 119 of file XrdClStream.hh.
Referenced by ~StreamMutex(), Lock(), Lock(), Lock(), and UnLock().