mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-18 10:46:23 +00:00
Add is_watching method
This commit is contained in:
parent
68b8f94b01
commit
4c525ae281
@ -195,6 +195,13 @@ int _watch(struct __sourceloc __whence, struct sched_ent *alarm)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int is_watching(struct sched_ent *alarm)
|
||||
{
|
||||
if (alarm->_poll_index <0 || fds[alarm->_poll_index].fd!=alarm->poll.fd)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// stop watching a file handle
|
||||
int _unwatch(struct __sourceloc __whence, struct sched_ent *alarm)
|
||||
{
|
||||
|
@ -63,6 +63,7 @@ struct sched_ent{
|
||||
};
|
||||
|
||||
int is_scheduled(const struct sched_ent *alarm);
|
||||
int is_watching(struct sched_ent *alarm);
|
||||
int _schedule(struct __sourceloc, struct sched_ent *alarm);
|
||||
int _unschedule(struct __sourceloc, struct sched_ent *alarm);
|
||||
int _watch(struct __sourceloc, struct sched_ent *alarm);
|
||||
|
Loading…
Reference in New Issue
Block a user