aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llimage
diff options
context:
space:
mode:
authorDavid Seikel2011-02-20 20:31:57 +1000
committerDavid Seikel2011-02-20 20:31:57 +1000
commitd6666d0776985bada40f19c623b86d82a4113f92 (patch)
treeeb4d234a313c51b40f6d53d4a59bdc831a7cd0fc /linden/indra/llimage
parentRemove catering to LL's probably illegal attempt to block copying of open sou... (diff)
parentReduce the logging spam to warnings. Debug was too much. (diff)
downloadmeta-impy-d6666d0776985bada40f19c623b86d82a4113f92.zip
meta-impy-d6666d0776985bada40f19c623b86d82a4113f92.tar.gz
meta-impy-d6666d0776985bada40f19c623b86d82a4113f92.tar.bz2
meta-impy-d6666d0776985bada40f19c623b86d82a4113f92.tar.xz
Merge branch 'weekly' into branding
Conflicts (solved): linden/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp linden/indra/newview/llappviewer.cpp linden/indra/newview/llappviewerwin32.cpp
Diffstat (limited to 'linden/indra/llimage')
-rw-r--r--linden/indra/llimage/llimage.cpp2
-rw-r--r--linden/indra/llimage/llimagej2c.cpp15
-rw-r--r--linden/indra/llimage/llimageworker.cpp7
-rw-r--r--linden/indra/llimage/llimageworker.h2
4 files changed, 10 insertions, 16 deletions
diff --git a/linden/indra/llimage/llimage.cpp b/linden/indra/llimage/llimage.cpp
index 776c481..e933750 100644
--- a/linden/indra/llimage/llimage.cpp
+++ b/linden/indra/llimage/llimage.cpp
@@ -57,7 +57,7 @@ LLMutex* LLImage::sMutex = NULL;
57//static 57//static
58void LLImage::initClass(const bool& useDSO) 58void LLImage::initClass(const bool& useDSO)
59{ 59{
60 sMutex = new LLMutex(NULL); 60 sMutex = new LLMutex;
61 if (useDSO) 61 if (useDSO)
62 { 62 {
63 LLImageJ2C::openDSO(); 63 LLImageJ2C::openDSO();
diff --git a/linden/indra/llimage/llimagej2c.cpp b/linden/indra/llimage/llimagej2c.cpp
index b99ebff..9e88bcd 100644
--- a/linden/indra/llimage/llimagej2c.cpp
+++ b/linden/indra/llimage/llimagej2c.cpp
@@ -46,7 +46,7 @@ typedef const char* (*EngineInfoLLImageJ2CFunction)();
46CreateLLImageJ2CFunction j2cimpl_create_func; 46CreateLLImageJ2CFunction j2cimpl_create_func;
47DestroyLLImageJ2CFunction j2cimpl_destroy_func; 47DestroyLLImageJ2CFunction j2cimpl_destroy_func;
48EngineInfoLLImageJ2CFunction j2cimpl_engineinfo_func; 48EngineInfoLLImageJ2CFunction j2cimpl_engineinfo_func;
49apr_pool_t *j2cimpl_dso_memory_pool; 49AIAPRPool j2cimpl_dso_memory_pool;
50apr_dso_handle_t *j2cimpl_dso_handle; 50apr_dso_handle_t *j2cimpl_dso_handle;
51 51
52//Declare the prototype for theses functions here, their functionality 52//Declare the prototype for theses functions here, their functionality
@@ -81,13 +81,12 @@ void LLImageJ2C::openDSO()
81 gDirUtilp->getExecutableDir()); 81 gDirUtilp->getExecutableDir());
82 82
83 j2cimpl_dso_handle = NULL; 83 j2cimpl_dso_handle = NULL;
84 j2cimpl_dso_memory_pool = NULL; 84 j2cimpl_dso_memory_pool.create();
85 85
86 //attempt to load the shared library 86 //attempt to load the shared library
87 apr_pool_create(&j2cimpl_dso_memory_pool, NULL);
88 rv = apr_dso_load(&j2cimpl_dso_handle, 87 rv = apr_dso_load(&j2cimpl_dso_handle,
89 dso_path.c_str(), 88 dso_path.c_str(),
90 j2cimpl_dso_memory_pool); 89 j2cimpl_dso_memory_pool());
91 90
92 //now, check for success 91 //now, check for success
93 if ( rv == APR_SUCCESS ) 92 if ( rv == APR_SUCCESS )
@@ -151,11 +150,7 @@ void LLImageJ2C::openDSO()
151 j2cimpl_dso_handle = NULL; 150 j2cimpl_dso_handle = NULL;
152 } 151 }
153 152
154 if ( j2cimpl_dso_memory_pool ) 153 j2cimpl_dso_memory_pool.destroy();
155 {
156 apr_pool_destroy(j2cimpl_dso_memory_pool);
157 j2cimpl_dso_memory_pool = NULL;
158 }
159 } 154 }
160} 155}
161 156
@@ -163,7 +158,7 @@ void LLImageJ2C::openDSO()
163void LLImageJ2C::closeDSO() 158void LLImageJ2C::closeDSO()
164{ 159{
165 if ( j2cimpl_dso_handle ) apr_dso_unload(j2cimpl_dso_handle); 160 if ( j2cimpl_dso_handle ) apr_dso_unload(j2cimpl_dso_handle);
166 if (j2cimpl_dso_memory_pool) apr_pool_destroy(j2cimpl_dso_memory_pool); 161 j2cimpl_dso_memory_pool.destroy();
167} 162}
168 163
169//static 164//static
diff --git a/linden/indra/llimage/llimageworker.cpp b/linden/indra/llimage/llimageworker.cpp
index 558a968..dc989e5 100644
--- a/linden/indra/llimage/llimageworker.cpp
+++ b/linden/indra/llimage/llimageworker.cpp
@@ -41,14 +41,13 @@
41LLImageDecodeThread::LLImageDecodeThread(bool threaded) 41LLImageDecodeThread::LLImageDecodeThread(bool threaded)
42 : LLQueuedThread("imagedecode", threaded) 42 : LLQueuedThread("imagedecode", threaded)
43{ 43{
44 mCreationMutex = new LLMutex(getAPRPool());
45} 44}
46 45
47// MAIN THREAD 46// MAIN THREAD
48// virtual 47// virtual
49S32 LLImageDecodeThread::update(U32 max_time_ms) 48S32 LLImageDecodeThread::update(U32 max_time_ms)
50{ 49{
51 LLMutexLock lock(mCreationMutex); 50 LLMutexLock lock(&mCreationMutex);
52 for (creation_list_t::iterator iter = mCreationList.begin(); 51 for (creation_list_t::iterator iter = mCreationList.begin();
53 iter != mCreationList.end(); ++iter) 52 iter != mCreationList.end(); ++iter)
54 { 53 {
@@ -71,7 +70,7 @@ S32 LLImageDecodeThread::update(U32 max_time_ms)
71LLImageDecodeThread::handle_t LLImageDecodeThread::decodeImage(LLImageFormatted* image, 70LLImageDecodeThread::handle_t LLImageDecodeThread::decodeImage(LLImageFormatted* image,
72 U32 priority, S32 discard, BOOL needs_aux, Responder* responder) 71 U32 priority, S32 discard, BOOL needs_aux, Responder* responder)
73{ 72{
74 LLMutexLock lock(mCreationMutex); 73 LLMutexLock lock(&mCreationMutex);
75 handle_t handle = generateHandle(); 74 handle_t handle = generateHandle();
76 mCreationList.push_back(creation_info(handle, image, priority, discard, needs_aux, responder)); 75 mCreationList.push_back(creation_info(handle, image, priority, discard, needs_aux, responder));
77 return handle; 76 return handle;
@@ -81,7 +80,7 @@ LLImageDecodeThread::handle_t LLImageDecodeThread::decodeImage(LLImageFormatted*
81// Returns the size of the mutex guarded list as an indication of sanity 80// Returns the size of the mutex guarded list as an indication of sanity
82S32 LLImageDecodeThread::tut_size() 81S32 LLImageDecodeThread::tut_size()
83{ 82{
84 LLMutexLock lock(mCreationMutex); 83 LLMutexLock lock(&mCreationMutex);
85 S32 res = mCreationList.size(); 84 S32 res = mCreationList.size();
86 return res; 85 return res;
87} 86}
diff --git a/linden/indra/llimage/llimageworker.h b/linden/indra/llimage/llimageworker.h
index 0260206..fa2a8fa 100644
--- a/linden/indra/llimage/llimageworker.h
+++ b/linden/indra/llimage/llimageworker.h
@@ -101,7 +101,7 @@ private:
101 }; 101 };
102 typedef std::list<creation_info> creation_list_t; 102 typedef std::list<creation_info> creation_list_t;
103 creation_list_t mCreationList; 103 creation_list_t mCreationList;
104 LLMutex* mCreationMutex; 104 LLMutex mCreationMutex;
105}; 105};
106 106
107#endif 107#endif