diff options
author | Shauren <shauren.trinity@gmail.com> | 2014-07-19 03:38:57 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2014-07-19 03:51:11 +0200 |
commit | 909acdbac3223d8c788b1b5dc42b6dfab8b604ab (patch) | |
tree | 2a0ade312aad77ca032015c6957a4a9005aa0b94 /dep/acelite/ace/Notification_Queue.h | |
parent | 5daf3d360686ea8ff2d97a48fca24f0bf42ef098 (diff) | |
parent | 1866d8cc06e2b8c2722ccf69ee3f52ceda93bc27 (diff) |
Merge remote-tracking branch 'origin/master' into 4.3.4
Conflicts:
src/server/authserver/Main.cpp
src/server/authserver/Realms/RealmList.cpp
src/server/authserver/Realms/RealmList.h
src/server/authserver/Server/AuthSession.cpp
src/server/authserver/Server/AuthSocket.h
src/server/authserver/Server/RealmAcceptor.h
src/server/game/Accounts/AccountMgr.h
src/server/game/Achievements/AchievementMgr.cpp
src/server/game/Achievements/AchievementMgr.h
src/server/game/Battlegrounds/ArenaTeamMgr.cpp
src/server/game/Conditions/ConditionMgr.cpp
src/server/game/DungeonFinding/LFGMgr.h
src/server/game/Entities/Object/Object.h
src/server/game/Entities/Player/Player.cpp
src/server/game/Entities/Player/Player.h
src/server/game/Entities/Unit/Unit.cpp
src/server/game/Handlers/BattleGroundHandler.cpp
src/server/game/Movement/Spline/MoveSplineFlag.h
src/server/game/Quests/QuestDef.cpp
src/server/game/Quests/QuestDef.h
src/server/game/Server/WorldSession.cpp
src/server/game/Server/WorldSession.h
src/server/game/Server/WorldSocket.cpp
src/server/game/Server/WorldSocket.h
src/server/game/Spells/Spell.cpp
src/server/scripts/Commands/cs_debug.cpp
src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp
src/server/scripts/Spells/spell_mage.cpp
src/server/scripts/Spells/spell_rogue.cpp
src/server/scripts/Spells/spell_shaman.cpp
src/server/scripts/Spells/spell_warrior.cpp
src/server/shared/Cryptography/BigNumber.h
src/server/worldserver/RemoteAccess/RASocket.cpp
src/server/worldserver/worldserver.conf.dist
Diffstat (limited to 'dep/acelite/ace/Notification_Queue.h')
-rw-r--r-- | dep/acelite/ace/Notification_Queue.h | 157 |
1 files changed, 0 insertions, 157 deletions
diff --git a/dep/acelite/ace/Notification_Queue.h b/dep/acelite/ace/Notification_Queue.h deleted file mode 100644 index d312e0cd2c7..00000000000 --- a/dep/acelite/ace/Notification_Queue.h +++ /dev/null @@ -1,157 +0,0 @@ -/** - * @file Notification_Queue.h - * - * $Id: Notification_Queue.h 95425 2012-01-09 11:09:43Z johnnyw $ - * - * @author Carlos O'Ryan <coryan@atdesk.com> - */ - -#ifndef ACE_NOTIFICATION_QUEUE_H -#define ACE_NOTIFICATION_QUEUE_H - -#include /**/ "ace/pre.h" - -#include "ace/Copy_Disabled.h" -#include "ace/Event_Handler.h" -#include "ace/Intrusive_List.h" -#include "ace/Intrusive_List_Node.h" -#include "ace/Unbounded_Queue.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Notification_Queue_Node - * - * @brief Helper class - */ -class ACE_Export ACE_Notification_Queue_Node - : public ACE_Intrusive_List_Node<ACE_Notification_Queue_Node> -{ -public: - /** - * @brief Constructor - */ - ACE_Notification_Queue_Node(); - - /** - * @brief Modifier change the contained buffer - */ - void set(ACE_Notification_Buffer const & rhs); - - /** - * @brief Accessor, fetch the contained buffer - */ - ACE_Notification_Buffer const & get() const; - - /** - * @brief Checks if the event handler matches the purge condition - */ - bool matches_for_purging(ACE_Event_Handler * eh) const; - - /** - * @brief Return true if clearing the mask would leave no - * notifications to deliver. - */ - bool mask_disables_all_notifications(ACE_Reactor_Mask mask); - - /** - * @brief Clear the notifications specified by @c mask - */ - void clear_mask(ACE_Reactor_Mask mask); - -private: - ACE_Notification_Buffer contents_; -}; - -/** - * @class ACE_Notification_Queue - * - * @brief Implements a user-space queue to send Reactor notifications. - * - * The ACE_Reactor uses a pipe to send wake up the thread running the - * event loop from other threads. This pipe can be limited in size - * under some operating systems. For some applications, this limit - * presents a problem. A user-space notification queue is used to - * overcome those limitations. The queue tries to use as few - * resources on the pipe as possible, while keeping all the data in - * user space. - * - * This code was refactored from Select_Reactor_Base. - */ -class ACE_Export ACE_Notification_Queue : private ACE_Copy_Disabled -{ -public: - ACE_Notification_Queue(); - ~ACE_Notification_Queue(); - - /** - * @brief Pre-allocate resources in the queue - */ - int open(); - - /** - * @brief Release all resources in the queue - */ - void reset(); - - /** - * @brief Remove all elements in the queue matching @c eh and @c mask - * - * I suggest reading the documentation in ACE_Reactor to find a more - * detailed description. This is just a helper function. - */ - int purge_pending_notifications(ACE_Event_Handler * eh, - ACE_Reactor_Mask mask); - - /** - * @brief Add a new notification to the queue - * - * @return -1 on failure, 1 if a new message should be sent through - * the pipe and 0 otherwise. - */ - int push_new_notification(ACE_Notification_Buffer const & buffer); - - /** - * @brief Extract the next notification from the queue - * - * @return -1 on failure, 1 if a message was popped, 0 otherwise - */ - int pop_next_notification( - ACE_Notification_Buffer & current, - bool & more_messages_queued, - ACE_Notification_Buffer & next); - -private: - /** - * @brief Allocate more memory for the queue - */ - int allocate_more_buffers(); - -private: - /// Keeps track of allocated arrays of type - /// ACE_Notification_Buffer. The idea is to amortize allocation - /// costs by allocating multiple ACE_Notification_Buffer objects at - /// a time. - ACE_Unbounded_Queue <ACE_Notification_Queue_Node*> alloc_queue_; - - typedef ACE_Intrusive_List<ACE_Notification_Queue_Node> Buffer_List; - - /// Keeps track of all pending notifications. - Buffer_List notify_queue_; - - /// Keeps track of all free buffers. - Buffer_List free_queue_; - - /// Synchronization for handling of queues. - ACE_SYNCH_MUTEX notify_queue_lock_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Notification_Queue.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* ACE_NOTIFICATION_QUEUE_H */ |