MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / timerfd_close

Function timerfd_close

components/libc/posix/io/timerfd/timerfd.c:65–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63};
64
65static int timerfd_close(struct dfs_file *file)
66{
67 struct rt_timerfd *tfd;
68
69 if (file->vnode->ref_count != 1)
70 return 0;
71
72 tfd = file->vnode->data;
73
74 if (tfd)
75 {
76 if (tfd->timer != RT_NULL)
77 {
78 rt_timer_stop(tfd->timer);
79 rt_timer_delete(tfd->timer);
80 tfd->timer = RT_NULL;
81 }
82
83 if (tfd->wqn.wqueue)
84 {
85 rt_wqueue_remove(&tfd->wqn);
86 }
87
88 rt_mutex_detach(&tfd->lock);
89 rt_free(tfd);
90 }
91
92 return 0;
93}
94
95static int timerfd_poll(struct dfs_file *file, struct rt_pollreq *req)
96{

Callers

nothing calls this directly

Calls 5

rt_timer_stopFunction · 0.85
rt_timer_deleteFunction · 0.85
rt_wqueue_removeFunction · 0.85
rt_mutex_detachFunction · 0.85
rt_freeFunction · 0.85

Tested by

no test coverage detected