~ubuntu-branches/ubuntu/wily/syslog-ng/wily-proposed

« back to all changes in this revision

Viewing changes to lib/ivykis/lib/man3/iv_task.3

  • Committer: Package Import Robot
  • Author(s): Gergely Nagy, Gergely Nagy
  • Date: 2013-11-04 15:27:37 UTC
  • mfrom: (1.3.12)
  • Revision ID: package-import@ubuntu.com-20131104152737-mqh6eqtna2xk97jq
Tags: 3.5.1-1
[ Gergely Nagy <algernon@madhouse-project.org> ]
* New upstream release.
  + Support auto-loading modules (Closes: #650814)
  + The SMTP module is available in syslog-ng-mod-smtp (Closes: #722746)
  + New modules: amqp, geoip, stomp, redis and smtp.
  + Multi-line input support (indented multiline and regexp-based)
  + Template type hinting for the MongoDB destination and $(format-json)
  + Support for unit suffixes in the configuration file
  + New filters, template functions and other miscellaneous changes
* New (team) maintainer, Laszlo Boszormenyi, Attila Szalay and myself
  added to Uploaders.
* Ship /var/lib/syslog-ng in the syslog-ng-core package, instead of
  creating it in the init script. Thanks Michael Biebl
  <biebl@debian.org> for the report & assistance. (Closes: #699942, #719910)
* Use dh-systemd for proper systemd-related maintainer scripts. Based on
  a patch by Michael Biebl <biebl@debian.org>. (Closes: #713982,
  #690067)
* Do not wait for syslog-ng to settle down during installation / update.
  This also fixes installing via debootstrap and a fake
  start-stop-daemon. (Closes: #714254)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.\" This man page is Copyright (C) 2003, 2010 Lennert Buytenhek.
2
 
.\" Permission is granted to distribute possibly modified copies
3
 
.\" of this page provided the header is included verbatim,
4
 
.\" and in case of nontrivial modification author and date
5
 
.\" of the modification is added to the header.
6
 
.TH iv_task 3 2010-08-15 "ivykis" "ivykis programmer's manual"
7
 
.SH NAME
8
 
iv_task_register, iv_task_unregister, iv_task_registered \- deal with ivykis tasks
9
 
.SH SYNOPSIS
10
 
.B #include <iv.h>
11
 
.sp
12
 
.nf
13
 
struct iv_task {
14
 
        void            *cookie;
15
 
        void            (*handler)(void *);
16
 
};
17
 
.fi
18
 
.sp
19
 
.BI "void IV_TASK_INIT(struct iv_task *" task ");"
20
 
.br
21
 
.BI "void iv_task_register(struct iv_task *" task ");"
22
 
.br
23
 
.BI "void iv_task_unregister(struct iv_task *" task ");"
24
 
.br
25
 
.BI "int iv_task_registered(struct iv_task *" task ");"
26
 
.br
27
 
.SH DESCRIPTION
28
 
The functions
29
 
.B iv_task_register
30
 
and
31
 
.B iv_task_unregister
32
 
register, respectively unregister, a task with the current thread's
33
 
ivykis event loop.
34
 
.B iv_task_registered
35
 
on a task returns true if that task is currently registered with ivykis.
36
 
.PP
37
 
A task is like a timer, but with an immediate timeout.  When a task
38
 
is registered, unless it is unregistered again first, the callback
39
 
function specified by
40
 
.B ->handler
41
 
is guaranteed to be called once, in the thread that the task was
42
 
registered in, some time after control returns to the ivykis main
43
 
loop but before ivykis will sleep for more events, with
44
 
.B ->cookie
45
 
as its first and sole argument.  When this happens, the task is
46
 
transparently unregistered.
47
 
.PP
48
 
Tasks are mainly used for scheduling code for execution where it is not
49
 
appropriate to directly run that code in the calling context (for
50
 
example, because the current context might be run as a callback function
51
 
where the caller expects certain conditions to remain invariant after
52
 
the callback completes).
53
 
.PP
54
 
The application is allowed to change the
55
 
.B ->cookie
56
 
and
57
 
.B ->handler
58
 
members at any time.
59
 
.PP
60
 
A given
61
 
.B struct iv_task
62
 
can only be registered in one thread at a time, and a task can only
63
 
be unregistered in the thread that it was registered from.
64
 
.PP
65
 
There is no limit on the number of tasks registered at once.
66
 
.PP
67
 
See
68
 
.BR iv_examples (3)
69
 
for programming examples.
70
 
.SH "SEE ALSO"
71
 
.BR ivykis (3),
72
 
.BR iv_examples (3)