mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-02-06 19:19:16 +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;
|
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
|
// stop watching a file handle
|
||||||
int _unwatch(struct __sourceloc __whence, struct sched_ent *alarm)
|
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_scheduled(const struct sched_ent *alarm);
|
||||||
|
int is_watching(struct sched_ent *alarm);
|
||||||
int _schedule(struct __sourceloc, struct sched_ent *alarm);
|
int _schedule(struct __sourceloc, struct sched_ent *alarm);
|
||||||
int _unschedule(struct __sourceloc, struct sched_ent *alarm);
|
int _unschedule(struct __sourceloc, struct sched_ent *alarm);
|
||||||
int _watch(struct __sourceloc, struct sched_ent *alarm);
|
int _watch(struct __sourceloc, struct sched_ent *alarm);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user