dlclose.c 657 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * File : dlclose.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006 - 2010, RT-Thread Development Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2010-11-17 yi.qiu first version
  13. */
  14. #include <rtthread.h>
  15. #include <rtm.h>
  16. int dlclose (void *handle)
  17. {
  18. rt_module_t module;
  19. RT_ASSERT(handle != RT_NULL);
  20. module = (rt_module_t)handle;
  21. module->nref--;
  22. if(module->nref <= 0)
  23. {
  24. rt_module_unload(module);
  25. }
  26. return RT_TRUE;
  27. }
  28. RTM_EXPORT(dlclose)