int main(int argc, char *argv[]) { struct at_pool *atp; struct athread *at; int *pid; plan_tests(4); atp = at_pool(1*1024*1024); assert(atp); pid = talloc(at_pool_ctx(atp), int); assert(pid); ok1((char *)pid >= (char *)atp->p->pool && (char *)pid < (char *)atp->p->pool + atp->p->poolsize); at = at_run(atp, test, pid); assert(at); ok1(at_read(at) == test); talloc_free(at); ok1(*pid != 0); ok1(*pid != getpid()); return exit_status(); }
int main(int argc, char *argv[]) { struct at_pool *atp; struct athread *at; int *val, i; plan_tests(3); atp = at_pool(1*1024*1024); assert(atp); val = talloc_zero(at_pool_ctx(atp), int); at = at_run(atp, test, val); assert(at); ok1(*val == 0); at_tell(at, test); /* We increment val, then sleep a little. */ for (i = 0; i < NUM_RUNS; i++) { at_lock(val); (*(volatile int *)val)++; usleep(i * 100); at_unlock(val); usleep(i * 100); } ok1(at_read(at) == val); talloc_free(at); ok1(*val == NUM_RUNS*2); return exit_status(); }
void appInit() { //Run Stream process at_run(); navdata_run(); //stream_run(); gAppAlive = 1; }