make main-fiber thread affine
static-cast to int for errc
correct forward declaration of scheduler
fix examples