Module: kamailio
Branch: master
Commit: 733a268114261d49ed11aec83fe39ea8c34a0b69
URL:
https://github.com/kamailio/kamailio/commit/733a268114261d49ed11aec83fe39ea…
Author: S-P Chan <shihping.chan(a)gmail.com>
Committer: S-P Chan <shihping.chan(a)gmail.com>
Date: 2024-01-31T16:47:09+08:00
db_mysql: use core/rthreads.h
---
Modified: src/modules/db_mysql/km_dbase.c
---
Diff:
https://github.com/kamailio/kamailio/commit/733a268114261d49ed11aec83fe39ea…
Patch:
https://github.com/kamailio/kamailio/commit/733a268114261d49ed11aec83fe39ea…
---
diff --git a/src/modules/db_mysql/km_dbase.c b/src/modules/db_mysql/km_dbase.c
index 721ba8aa6cf..9cd238b78ab 100644
--- a/src/modules/db_mysql/km_dbase.c
+++ b/src/modules/db_mysql/km_dbase.c
@@ -34,11 +34,11 @@
#include <stdio.h>
#include <string.h>
#include <mysql.h>
-#include <pthread.h>
#include <errmsg.h>
#include "../../core/mem/mem.h"
#include "../../core/dprint.h"
#include "../../core/async_task.h"
+#include "../../core/rthreads.h"
#include "../../lib/srdb1/db_query.h"
#include "../../lib/srdb1/db_ut.h"
#include "db_mysql.h"
@@ -213,13 +213,7 @@ static db1_con_t *db_mysql_init0(const str *_url)
db1_con_t *db_mysql_init(const str *_url)
{
- pthread_t tid;
- db1_con_t *ret;
-
- pthread_create(&tid, NULL, (void *(*)(void *))db_mysql_init0, (void *)_url);
- pthread_join(tid, (void **)&ret);
-
- return ret;
+ return run_threadP((_thread_proto)db_mysql_init0, (void *)_url);
}
/**
* Shut down the database module.