Change-Id: I5db98c4aed67d9648afdab5ae49abc3b9457da09
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
#include <parcel.hh>
#include <vconf.h>
#include <parcel.hh>
#include <vconf.h>
#include <string>
#include "parcelable_factory.hh"
#include <string>
#include "parcelable_factory.hh"
bool PkgInfoClient::RequestHandlerDirectAccess(
const std::vector<uint8_t>& raw) {
bool PkgInfoClient::RequestHandlerDirectAccess(
const std::vector<uint8_t>& raw) {
+ static std::mutex lock;
static void* handle = nullptr;
static void* handle = nullptr;
- static void* (*dl_func)(int, const unsigned char*, int, const char *);
+ static void* (*dl_func)(int, const unsigned char*, int, const char*);
+ std::unique_lock<std::mutex> u(lock);
if (handle == nullptr) {
handle = dlopen(LIBPKGMGR_INFO, RTLD_GLOBAL | RTLD_LAZY);
if (!handle) {
if (handle == nullptr) {
handle = dlopen(LIBPKGMGR_INFO, RTLD_GLOBAL | RTLD_LAZY);
if (!handle) {
return false;
}
dl_func = reinterpret_cast<void* (*)(
return false;
}
dl_func = reinterpret_cast<void* (*)(
- int, const unsigned char*, int, const char *)>(
+ int, const unsigned char*, int, const char*)>(
dlsym(handle, DIRECT_ACCESS_FUNC));
if (dl_func == nullptr) {
LOG(ERROR) << "cannot find " << DIRECT_ACCESS_FUNC << " symbol in "
dlsym(handle, DIRECT_ACCESS_FUNC));
if (dl_func == nullptr) {
LOG(ERROR) << "cannot find " << DIRECT_ACCESS_FUNC << " symbol in "
- reinterpret_cast<pkgmgr_common::parcel::AbstractParcelable *>(
+ reinterpret_cast<pkgmgr_common::parcel::AbstractParcelable*>(
dl_func(req_type_, &raw[0], raw.size(),
pkgmgr_common::SystemLocale::GetInst(false).Get().c_str())));
dl_func(req_type_, &raw[0], raw.size(),
pkgmgr_common::SystemLocale::GetInst(false).Get().c_str())));