projects
/
platform
/
core
/
telephony
/
tel-plugin-database.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix svace issue(WGID 379871)
[platform/core/telephony/tel-plugin-database.git]
/
src
/
database_main.c
diff --git
a/src/database_main.c
b/src/database_main.c
index
9756a3d
..
4a23f7c
100644
(file)
--- a/
src/database_main.c
+++ b/
src/database_main.c
@@
-37,6
+37,10
@@
#define PLUGIN_VERSION 1
#endif
#define PLUGIN_VERSION 1
#endif
+#define BUSY_WAITING_USEC 50000 /* 0.05 sec */
+#define BUSY_WAITING_MAX 20 /* wait for max 1 sec */
+
+
static gboolean __update_query_database(Storage *strg, void *handle, const char *query, GHashTable *in_param)
{
int rv = 0;
static gboolean __update_query_database(Storage *strg, void *handle, const char *query, GHashTable *in_param)
{
int rv = 0;
@@
-95,14
+99,13
@@
static gboolean __update_query_database(Storage *strg, void *handle, const char
static int _busy_handler(void *pData, int count)
{
static int _busy_handler(void *pData, int count)
{
- if (5 - count > 0) {
- dbg("Busy Handler Called! : CNT(%d)\n", count + 1);
- usleep((count + 1) * 100000);
+ if (count < BUSY_WAITING_MAX) {
+ usleep(BUSY_WAITING_USEC);
return 1;
return 1;
- } else {
- dbg("Busy Handler will be returned SQLITE_BUSY error\n");
- return 0;
}
}
+
+ dbg("Busy Handler will be returned SQLITE_BUSY error\n");
+ return 0;
}
static void *create_handle(Storage *strg, const char *path)
}
static void *create_handle(Storage *strg, const char *path)