replace Mutex with FastMutex

This commit is contained in:
Alex Fabijanic 2017-06-22 23:09:22 +02:00
parent 19417c57a9
commit 303861cf11
3 changed files with 10 additions and 10 deletions

View File

@ -62,7 +62,7 @@ public:
static void unregisterConnector(); static void unregisterConnector();
/// Unregisters the Connector under the Keyword Connector::KEY at the Poco::Data::SessionFactory /// Unregisters the Connector under the Keyword Connector::KEY at the Poco::Data::SessionFactory
static Poco::Mutex _mutex; static Poco::FastMutex _mutex;
}; };

View File

@ -30,7 +30,7 @@ namespace MySQL {
std::string Connector::KEY(POCO_DATA_MYSQL_CONNECTOR_NAME); std::string Connector::KEY(POCO_DATA_MYSQL_CONNECTOR_NAME);
Poco::Mutex Connector::_mutex; Poco::FastMutex Connector::_mutex;
Connector::Connector() Connector::Connector()
@ -53,7 +53,7 @@ Poco::AutoPtr<Poco::Data::SessionImpl> Connector::createSession(const std::strin
{ {
static bool initDone = false; static bool initDone = false;
{ {
Poco::Mutex::ScopedLock l(_mutex); Poco::FastMutex::ScopedLock l(_mutex);
if (!initDone) if (!initDone)
{ {
if (mysql_library_init(0, 0, 0) != 0) if (mysql_library_init(0, 0, 0) != 0)

View File

@ -6,16 +6,16 @@ MYSQL_DOCKER_VER=latest
# trying to conect prematurely will fail, 10s should be enough wait time # trying to conect prematurely will fail, 10s should be enough wait time
MYSQL_DB_START_WAIT=10 MYSQL_DB_START_WAIT=10
echo "running mysql docker container" echo "running poco-test-mysql docker container"
docker run -p 3306:3306 --name poco-test-mysql -e MYSQL_ROOT_PASSWORD=poco -e MYSQL_DATABASE=pocotestdb -d mysql:$MYSQL_DOCKER_VER docker run -p 3306:3306 --name poco-test-mysql -e MYSQL_ROOT_PASSWORD=poco -e MYSQL_DATABASE=pocotestdb -d mysql:$MYSQL_DOCKER_VER > /dev/null
echo "container up and running, sleeping $MYSQL_DB_START_WAIT seconds waiting for mysql db to start ..." echo "poco-test-mysql container up and running, sleeping $MYSQL_DB_START_WAIT seconds waiting for db to start ..."
sleep $MYSQL_DB_START_WAIT sleep $MYSQL_DB_START_WAIT
./bin/Linux/x86_64/testrunner -all ./bin/Linux/x86_64/testrunner -all
echo "stopping mysql docker container" echo "stopping poco-test-mysql docker container"
docker stop poco-test-mysql docker stop poco-test-mysql > /dev/null
echo "removing mysql docker container" echo "removing poco-test-mysql docker container"
docker rm poco-test-mysql docker rm poco-test-mysql > /dev/null