24 const char *ext =
".so";
26 const char *ext =
".dll";
41 if (pthread_mutex_lock(&fobj->
mutex) != 0)
46 AcquireSRWLockExclusive(&fobj->lock);
51 if (strcmp(fobj->
lib_name,
"default") == 0 && strcmp(fobj->
func_name,
"default") == 0)
67 strcpy(lib_with_ext, fobj->
lib_name);
68 strcat(lib_with_ext, ext);
70 strcpy_s(lib_with_ext,
sizeof(lib_with_ext), fobj->
lib_name);
71 strcat_s(lib_with_ext,
sizeof(lib_with_ext), ext);
75 fobj->
handle = dlopen(lib_with_ext, RTLD_LAZY);
77 fobj->
handle = LoadLibrary(lib_with_ext);
105 pthread_mutex_unlock(&fobj->
mutex);
107 ReleaseSRWLockExclusive(&fobj->lock);