threading cleanup: add mutex protection around moronic change to transcode. Add mutex to equiv issue in unac. Rename const strings everywhere to cstr_xx to ease future detection of potentially problematic static variables. Most probably close issue #65

This commit is contained in:
Jean-Francois Dockes
2011-09-28 15:01:14 +02:00
parent 80c86c4c5f
commit 424e4173ba
22 changed files with 411 additions and 151 deletions
+5 -1
View File
@@ -34,6 +34,8 @@
#include "rclaspell.h"
#include "debuglog.h"
#include "ptmutex.h"
// Just a place where we keep the Aspell library entry points together
class AspellApi {
public:
@@ -61,6 +63,7 @@ public:
};
static AspellApi aapi;
static PTMutexInit o_aapi_mutex;
#define NMTOPTR(NM, TP) \
if ((aapi.NM = TP dlsym(m_data->m_handle, #NM)) == 0) { \
@@ -111,6 +114,7 @@ Aspell::~Aspell()
bool Aspell::init(string &reason)
{
PTMutexLocker locker(o_aapi_mutex);
deleteZ(m_data);
// Language: we get this from the configuration, else from the NLS
@@ -227,7 +231,7 @@ bool Aspell::init(string &reason)
return true;
}
bool Aspell::ok()
bool Aspell::ok() const
{
return m_data != 0 && m_data->m_handle != 0;
}
+1 -1
View File
@@ -50,7 +50,7 @@ class Aspell {
~Aspell();
/** Check health */
bool ok();
bool ok() const;
/** Find the aspell command and shared library, init function pointers */
bool init(string &reason);