Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1015 B

  1. .TH iom_init 3
  2. .SH NAME
  3. iom_init \- create new I/O multiplexer
  5. .B #include <libowfat/io.h>
  6. int \fBiom_init\fP(iomux_t* c);
  8. iom_init initializes an I/O multiplexer.
  9. An I/O multiplexer is a context that can be used to do I/O multiplexing
  10. with support for multiple threads. Add events to a multiplexer using
  11. \fIiom_add\fR, and then get the next available event with
  12. \fIiom_wait\fR. If you are done and want to signal all the threads
  13. something, set a volatile global variable to tell the threads to stop
  14. and then fall \fIiom_abort\fR to tell all pending iom_wait operations in
  15. all threads to return immediately.
  16. After \fIiom_init\fR is done, \fIiom_add\fR and \fIiom_wait\fR can be
  17. called from different threads on the same context, and they will
  18. synchronize internally.
  19. .SH "LINKING"
  20. You may have to add \fI-lpthread\fR to the command line in the linking
  21. step.
  23. iom_init returns 0 on success and -1 on error, setting errno.
  24. .SH "SEE ALSO"
  25. iom_add, iom_wait, iom_abort