1 /* Copyright (c) 2015 Regents of the University of California
3 * Author: Brian Demsky <bdemsky@uci.edu>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
12 #include "threads-model.h"
14 /* global "model" object */
18 * User program API functions
20 int thrd_create(thrd_t *t, thrd_start_t start_routine, void *arg)
22 model->get_execution()->threadCreate(t, start_routine, arg);
26 int thrd_join(thrd_t t)
29 model->get_execution()->threadJoin(th);
35 model->get_execution()->threadYield();
38 thrd_t thrd_current(void)
40 return thread_current()->get_thrd_t();