void initHeap(void) { if(initialized) return; if(usemcrt(&heapSem,1) < 0) error("Unable to create heap lock"); initialized = true; }
int mod_thread(A_UNUSED int argc,A_UNUSED char *argv[]) { int threads[THREAD_COUNT]; if(usemcrt(&usem,1) < 0) error("Unable to create lock"); size_t i; for(i = 0; i < THREAD_COUNT; i++) sassert((threads[i] = startthread(myThread,NULL)) >= 0); for(i = 0; i < THREAD_COUNT; i++) join(threads[i]); return EXIT_SUCCESS; }