import RT-Thread@9217865c without bsp, libcpu and components/net
This commit is contained in:
commit
e2376a3709
1414 changed files with 390370 additions and 0 deletions
39
components/libc/posix/libdl/dlclose.c
Normal file
39
components/libc/posix/libdl/dlclose.c
Normal file
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2010-11-17 yi.qiu first version
|
||||
*/
|
||||
|
||||
#include <rtthread.h>
|
||||
#include <rtm.h>
|
||||
|
||||
#include "dlmodule.h"
|
||||
|
||||
int dlclose(void *handle)
|
||||
{
|
||||
struct rt_dlmodule *module;
|
||||
|
||||
RT_ASSERT(handle != RT_NULL);
|
||||
|
||||
module = (struct rt_dlmodule *)handle;
|
||||
|
||||
rt_enter_critical();
|
||||
module->nref--;
|
||||
if (module->nref <= 0)
|
||||
{
|
||||
rt_exit_critical();
|
||||
|
||||
dlmodule_destroy(module);
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_exit_critical();
|
||||
}
|
||||
|
||||
return RT_TRUE;
|
||||
}
|
||||
RTM_EXPORT(dlclose)
|
Loading…
Add table
Add a link
Reference in a new issue