diff options
-rwxr-xr-x | email-core/email-storage/email-storage.c | 18 | ||||
-rwxr-xr-x | utilities/test-application/testapp-others.c | 2 |
2 files changed, 2 insertions, 18 deletions
diff --git a/email-core/email-storage/email-storage.c b/email-core/email-storage/email-storage.c index e556bfc..9618f03 100755 --- a/email-core/email-storage/email-storage.c +++ b/email-core/email-storage/email-storage.c @@ -187,8 +187,6 @@ } /* for safety DB operation */ -static pthread_mutex_t _transactionBeginLock = PTHREAD_MUTEX_INITIALIZER; -static pthread_mutex_t _transactionEndLock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t _db_handle_lock = PTHREAD_MUTEX_INITIALIZER; #define _MULTIPLE_DB_HANDLE @@ -1382,9 +1380,6 @@ static void _emstorage_close_once(void) { EM_DEBUG_FUNC_BEGIN(); - DELETE_CRITICAL_SECTION(_transactionBeginLock); - DELETE_CRITICAL_SECTION(_transactionEndLock); - EM_DEBUG_FUNC_END(); } @@ -1618,9 +1613,6 @@ INTERNAL_FUNC int emstorage_db_close(int *err_code) int error = EMAIL_ERROR_NONE; int ret = false; - DELETE_CRITICAL_SECTION(_transactionBeginLock); - DELETE_CRITICAL_SECTION(_transactionEndLock); - if (_db_handle) { ret = db_util_close(_db_handle); @@ -10319,8 +10311,6 @@ INTERNAL_FUNC int emstorage_begin_transaction(void *d1, void *d2, int *err_code) EM_PROFILE_BEGIN(emStorageBeginTransaction); int ret = true; - ENTER_CRITICAL_SECTION(_transactionBeginLock); - /* wait for the trnasaction authority to be changed. */ while (g_transaction) { EM_DEBUG_LOG(">>>>>>>> Wait for the transaction authority to be changed"); @@ -10330,8 +10320,6 @@ INTERNAL_FUNC int emstorage_begin_transaction(void *d1, void *d2, int *err_code) /* take the transaction authority. */ g_transaction = true; - LEAVE_CRITICAL_SECTION(_transactionBeginLock); - sqlite3 *local_db_handle = emstorage_get_db_connection(); int rc; EMSTORAGE_PROTECTED_FUNC_CALL(sqlite3_exec(local_db_handle, "BEGIN immediate;", NULL, NULL, NULL), rc); @@ -10356,15 +10344,12 @@ INTERNAL_FUNC int emstorage_commit_transaction(void *d1, void *d2, int *err_code int ret = true; sqlite3 *local_db_handle = emstorage_get_db_connection(); - ENTER_CRITICAL_SECTION(_transactionEndLock); - int rc; EMSTORAGE_PROTECTED_FUNC_CALL(sqlite3_exec(local_db_handle, "END;", NULL, NULL, NULL), rc); EM_DEBUG_DB_EXEC(SQLITE_OK != rc, {ret = false; }, ("SQL(END) exec error:%d -%s", rc, sqlite3_errmsg(local_db_handle))); /* release the transaction authority. */ g_transaction = false; - LEAVE_CRITICAL_SECTION(_transactionEndLock); if (ret == false && err_code != NULL) *err_code = EMAIL_ERROR_DB_FAILURE; @@ -10380,6 +10365,7 @@ INTERNAL_FUNC int emstorage_rollback_transaction(void *d1, void *d2, int *err_co int rc; EMSTORAGE_PROTECTED_FUNC_CALL(sqlite3_exec(local_db_handle, "ROLLBACK;", NULL, NULL, NULL), rc); + EM_DEBUG_DB_EXEC(SQLITE_OK != rc, {ret = false; }, ("SQL(ROLLBACK) exec error:%d -%s", rc, sqlite3_errmsg(local_db_handle))); @@ -10388,8 +10374,6 @@ INTERNAL_FUNC int emstorage_rollback_transaction(void *d1, void *d2, int *err_co /* release the transaction authority. */ g_transaction = false; - LEAVE_CRITICAL_SECTION(_transactionEndLock); - if (ret == false && err_code != NULL) *err_code = EMAIL_ERROR_DB_FAILURE; diff --git a/utilities/test-application/testapp-others.c b/utilities/test-application/testapp-others.c index 14d3dd3..487bc46 100755 --- a/utilities/test-application/testapp-others.c +++ b/utilities/test-application/testapp-others.c @@ -208,7 +208,7 @@ FINISH_OFF: return error; } -#define LIB_EMAIL_SERVICE_PATH "/usr/lib/libemail-api.so" +#define LIB_EMAIL_SERVICE_PATH LIBPATH "libemail-api.so" int (*Datastore_FI_EMTB)(char **); int (*Datastore_FI_EMSB)(char **); |