summaryrefslogtreecommitdiffstats
path: root/lib/waiter
Commit message (Collapse)AuthorAgeFilesLines
* lib/waiter: Add timeout waitersJeremy Kerr2013-06-242-34/+146
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/waiter: Ensure waiters are consistent during waiter_pollJeremy Kerr2013-05-211-19/+43
| | | | | | | | | | | | | | | | We have a bug at the moment: if the waitset's->waiters array is updated duing waiter_poll() (eg, a client connection is closed, and the client's callback performs a waiter_remove()), then we may invoke callbacks for incorrect waiters. This change uses a consistent waiters array duing execution of waiter_poll, so that any pollfds returned from poll() will result in correct callback invocations. This assumes that a waiter will only ever remove *itself* from the waitset; otherwise, we may call a free()ed waiter. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/waiter: allocate waiters separately from set->waitersJeremy Kerr2013-05-211-13/+22
| | | | | | | | | | Since we reallocate set->waiters, we can't hand out pointers to within that array. Instead, this change allocates the 'struct waiter's separately from the set->waiters array. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* waiter: Don't rely on global variables to keep waiter stateJeremy Kerr2013-04-102-34/+57
| | | | | | | | | Rather than defining the set of waiters (and pollfds) in waiter.c, add a struct waitset to contain these. A waitset is created with waitset_create, which is passed to the waiter_* functions. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
* Fix waiter_register return valueGeoff Levand2011-11-031-1/+5
|
* Fix memmove sizeGeoff Levand2009-06-301-1/+2
| | | | | | | Correct the byte count for several memmove calls. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Fix waiter allocGeoff Levand2009-02-011-1/+2
| | | | | | | | Add the missing assignment of the global n_pollfds variable. Fix a minor memory leak in waiter_poll(). Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Move waiter to libraryGeoff Levand2009-02-012-0/+106
Move the waiter routines into the petitboot library. The waiter routines are generic enough to be used for both server and client. Does not change the waiter source. jk: move to lib/waiter/ instead of lib/ Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
OpenPOWER on IntegriCloud