aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmessage/llpumpio.h
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llmessage/llpumpio.h')
-rw-r--r--linden/indra/llmessage/llpumpio.h31
1 files changed, 10 insertions, 21 deletions
diff --git a/linden/indra/llmessage/llpumpio.h b/linden/indra/llmessage/llpumpio.h
index fc0bfab..2666be0 100644
--- a/linden/indra/llmessage/llpumpio.h
+++ b/linden/indra/llmessage/llpumpio.h
@@ -36,11 +36,12 @@
36#define LL_LLPUMPIO_H 36#define LL_LLPUMPIO_H
37 37
38#include <set> 38#include <set>
39#include <boost/shared_ptr.hpp>
39#if LL_LINUX // needed for PATH_MAX in APR. 40#if LL_LINUX // needed for PATH_MAX in APR.
40#include <sys/param.h> 41#include <sys/param.h>
41#endif 42#endif
42 43
43#include "apr_pools.h" 44#include "aiaprpool.h"
44#include "llbuffer.h" 45#include "llbuffer.h"
45#include "llframetimer.h" 46#include "llframetimer.h"
46#include "lliopipe.h" 47#include "lliopipe.h"
@@ -64,9 +65,8 @@ extern const F32 NEVER_CHAIN_EXPIRY_SECS;
64 * <code>pump()</code> on a thread used for IO and call 65 * <code>pump()</code> on a thread used for IO and call
65 * <code>respond()</code> on a thread that is expected to do higher 66 * <code>respond()</code> on a thread that is expected to do higher
66 * level processing. You can call almost any other method from any 67 * level processing. You can call almost any other method from any
67 * thread - see notes for each method for details. In order for the 68 * thread - see notes for each method for details.
68 * threading abstraction to work, you need to call <code>prime()</code> 69 *
69 * with a valid apr pool.
70 * A pump instance manages much of the state for the pipe, including 70 * A pump instance manages much of the state for the pipe, including
71 * the list of pipes in the chain, the channel for each element in the 71 * the list of pipes in the chain, the channel for each element in the
72 * chain, the buffer, and if any pipe has marked the stream or process 72 * chain, the buffer, and if any pipe has marked the stream or process
@@ -85,7 +85,7 @@ public:
85 /** 85 /**
86 * @brief Constructor. 86 * @brief Constructor.
87 */ 87 */
88 LLPumpIO(apr_pool_t* pool); 88 LLPumpIO(void);
89 89
90 /** 90 /**
91 * @brief Destructor. 91 * @brief Destructor.
@@ -93,17 +93,6 @@ public:
93 ~LLPumpIO(); 93 ~LLPumpIO();
94 94
95 /** 95 /**
96 * @brief Prepare this pump for usage.
97 *
98 * If you fail to call this method prior to use, the pump will
99 * try to work, but will not come with any thread locking
100 * mechanisms.
101 * @param pool The apr pool to use.
102 * @return Returns true if the pump is primed.
103 */
104 bool prime(apr_pool_t* pool);
105
106 /**
107 * @brief Typedef for having a chain of pipes. 96 * @brief Typedef for having a chain of pipes.
108 */ 97 */
109 typedef std::vector<LLIOPipe::ptr_t> chain_t; 98 typedef std::vector<LLIOPipe::ptr_t> chain_t;
@@ -374,6 +363,7 @@ protected:
374 typedef std::pair<LLIOPipe::ptr_t, apr_pollfd_t> pipe_conditional_t; 363 typedef std::pair<LLIOPipe::ptr_t, apr_pollfd_t> pipe_conditional_t;
375 typedef std::vector<pipe_conditional_t> conditionals_t; 364 typedef std::vector<pipe_conditional_t> conditionals_t;
376 conditionals_t mDescriptors; 365 conditionals_t mDescriptors;
366 boost::shared_ptr<AIAPRPool> mDescriptorsPool;
377 }; 367 };
378 368
379 // All the running chains & info 369 // All the running chains & info
@@ -392,9 +382,9 @@ protected:
392 callbacks_t mPendingCallbacks; 382 callbacks_t mPendingCallbacks;
393 callbacks_t mCallbacks; 383 callbacks_t mCallbacks;
394 384
395 // memory allocator for pollsets & mutexes. 385 // Memory pool for pollsets & mutexes.
396 apr_pool_t* mPool; 386 AIAPRPool mPool;
397 apr_pool_t* mCurrentPool; 387 AIAPRPool mCurrentPool;
398 S32 mCurrentPoolReallocCount; 388 S32 mCurrentPoolReallocCount;
399 389
400#if LL_THREADS_APR 390#if LL_THREADS_APR
@@ -406,8 +396,7 @@ protected:
406#endif 396#endif
407 397
408protected: 398protected:
409 void initialize(apr_pool_t* pool); 399 void initialize();
410 void cleanup();
411 400
412 /** 401 /**
413 * @brief Given the internal state of the chains, rebuild the pollset 402 * @brief Given the internal state of the chains, rebuild the pollset