* @brief retrieve the dynamically loaded module that the current thread belongs to. * * @return struct rt_dlmodule* On success, it returns a pointer to the module. otherwise, it returns RT_NULL. */
| 410 | * @return struct rt_dlmodule* On success, it returns a pointer to the module. otherwise, it returns RT_NULL. |
| 411 | */ |
| 412 | struct rt_dlmodule *dlmodule_self(void) |
| 413 | { |
| 414 | rt_thread_t tid; |
| 415 | struct rt_dlmodule *ret = RT_NULL; |
| 416 | |
| 417 | tid = rt_thread_self(); |
| 418 | if (tid) |
| 419 | { |
| 420 | ret = (struct rt_dlmodule*) tid->parent.module_id; |
| 421 | } |
| 422 | |
| 423 | return ret; |
| 424 | } |
| 425 | |
| 426 | /* |
| 427 | * Compatible with old API |
no test coverage detected