我使用了libdl,使用的是官方提供的一个例子(在examplesmodule中的自己稍微改了一下),首先使用finsh下面执行extapp.so,在extapp中我使用dlopen打开了basicapp,然后执行了其中一个函数,按道理在最后使用了dlclose(handle);应该是卸载了,但是使用list_module()发现还在,如下
```module name ref
basicapp -1
extapp 1
0, 0x00000000```
但thread没有了
请问一下这个是什么问题啊?
basicapp.c
```#include
static int a = 0;
static int b = 1000000;
int c = 100;
static void function(int count1, int count2, int count3)
{
rt_kprintf(“Hello RT-Thread %d %d
“, count1, count2, count3);
}
int main(void)
{
int i;
“);
rt_kprintf(“[addr]a-0x%x,b-0x%x,c-0x%x
“, &a, &b, &c);
rt_kprintf(“[value]a-%d,b-%d,c-%d
“, a, b, c);
}
int fn()
{
rt_kprintf(“fn!
“);
return 0;
}```
extapp.so
```#include
typedef void (*func)(void);
int main(void)
{
func f1, f2, f3, f4, f5;
“);
if(handle != RT_NULL)
{
f1= (func)dlsym(handle, “fn”);
if(f1 != RT_NULL) (*f1)();
else rt_kprintf(“dlsym fn failed.
“);
}
}```