Add lwevent_exit()
This commit is contained in:
parent
c7663cc4a2
commit
51e14f327f
|
@ -71,6 +71,18 @@ int lwevent_init(void)
|
|||
|
||||
|
||||
|
||||
/* lwevent_exit()
|
||||
* Cleans up resources used by lwevent, putting the library into a state where it is ready to be
|
||||
* re-initialised with lwevent_init().
|
||||
*/
|
||||
void lwevent_exit(void)
|
||||
{
|
||||
close(lwevent_epoll_fd);
|
||||
free(_lw_revents);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* lwevent_loop()
|
||||
* Convenience function which just keeps calling lwevent_wait(), with no timeout, until an error
|
||||
* occurs or lwevent_loop_exit is set.
|
||||
|
|
|
@ -32,6 +32,19 @@ int lwevent_init(void);
|
|||
|
||||
|
||||
|
||||
/*! \brief Shut down library.
|
||||
|
||||
Cleans up the library, closing the epoll file descriptor and freeing any memory used. Does not
|
||||
free any of the memory associated with <code>struct lwevent</code> objects. If the library were to
|
||||
be reinitialised, any objects that persisted could be activated on the new epoll file descriptor
|
||||
with lwevent_reactivate(). Otherwise, such objects can be freed (even after exiting) with
|
||||
lwevent_free().
|
||||
|
||||
*/
|
||||
void lwevent_exit(void);
|
||||
|
||||
|
||||
|
||||
/*! \brief Event loop exit flag.
|
||||
|
||||
This flag, if set, signifies that lwevent_loop() should exit after its next iteration. It can be
|
||||
|
|
Loading…
Reference in New Issue