Skip to content
Snippets Groups Projects
Commit de1e3dc4 authored by rswindell's avatar rswindell
Browse files

Added test to see how long sem_trywait_block takes to timeout.

parent 95f26dbf
No related branches found
No related tags found
No related merge requests found
......@@ -278,6 +278,10 @@ int main()
}
sem_wait(&thread_data.child_sem); /* wait for thread to end */
}
printf("\nsem_trywait_block test...");
t=time(NULL);
sem_trywait_block(&thread_data.parent_sem,5000);
printf("\ntimed-out after %ld seconds (should be 5 seconds)\n",time(NULL)-t);
sem_destroy(&thread_data.parent_sem);
sem_destroy(&thread_data.child_sem);
return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment