Remove word duplicates in some manual pages.
[dragonfly.git] / lib / libpuffs / puffs_cc.3
1 .\"     $NetBSD: puffs_cc.3,v 1.14 2009/04/11 16:48:53 wiz Exp $
2 .\"
3 .\" Copyright (c) 2007, 2008 Antti Kantee.  All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\"
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 .\" SUCH DAMAGE.
25 .\"
26 .Dd February 5, 2012
27 .Dt PUFFS_CC 3
28 .Os
29 .Sh NAME
30 .Nm puffs_cc
31 .Nd puffs continuation routines
32 .Sh LIBRARY
33 .Lb libpuffs
34 .Sh SYNOPSIS
35 .In puffs.h
36 .Ft void
37 .Fn puffs_cc_yield "struct puffs_cc *pcc"
38 .Ft void
39 .Fn puffs_cc_continue "struct puffs_cc *pcc"
40 .Ft void
41 .Fn puffs_cc_schedule "struct puffs_cc *pcc"
42 .Ft struct puffs_cc *
43 .Fn puffs_cc_getcc "struct puffs_usermount *pu"
44 .Sh DESCRIPTION
45 These routines are used for the cooperative multitasking suite present
46 in puffs.
47 .Bl -tag -width xxxx
48 .It Fn puffs_cc_yield "pcc"
49 Suspend and save the current execution context and return control
50 to the previous point.
51 In practice, from the file system author perspective, control returns
52 back to where either the mainloop or where
53 .Fn puffs_dispatch_exec
54 was called from.
55 .It Fn puffs_cc_continue pcc
56 Will suspend current execution and return control to where it was
57 before calling
58 .Fn puffs_cc_yield .
59 This is rarely called directly but rather through
60 .Fn puffs_dispatch_exec .
61 .It Fn puffs_cc_schedule "pcc"
62 Schedule a continuation.
63 As opposed to
64 .Fn puffs_cc_continue
65 this call returns immediately.
66 .Fa pcc
67 will be scheduled sometime in the future.
68 .It Fn puffs_cc_getcc "pu"
69 Returns the current pcc or
70 .Dv NULL
71 if this is the main thread.
72 .Em NOTE :
73 The argument
74 .Ar pu
75 will most likely disappear at some point.
76 .El
77 .Pp
78 Before calling
79 .Fn puffs_cc_yield
80 a file system will typically want to record some cookie value into its
81 own internal bookkeeping.
82 This cookie should be hooked to the
83 .Va pcc
84 so that the correct continuation can be continued when the event it
85 was waiting for triggers.
86 Alternatively, the
87 .Xr puffs_framebuf 3
88 framework and
89 .Fn puffs_mainloop
90 can be used for handling this automatically.
91 .Sh SEE ALSO
92 .Xr puffs 3 ,
93 .Xr puffs_framebuf 3