From afed23d648be13ec393f57a3c51be4edf69b3464 Mon Sep 17 00:00:00 2001 From: Fabio Scotto di Santolo Date: Sun, 15 Sep 2024 14:33:10 +0200 Subject: [PATCH] Create skeleton for chapters 6 and 7 --- chp6_scheduler/test_thread_scope.c | 20 ++++++++++++++++++++ chp7_deadlock/.gitkeep | 0 2 files changed, 20 insertions(+) create mode 100644 chp6_scheduler/test_thread_scope.c create mode 100644 chp7_deadlock/.gitkeep diff --git a/chp6_scheduler/test_thread_scope.c b/chp6_scheduler/test_thread_scope.c new file mode 100644 index 0000000..4355309 --- /dev/null +++ b/chp6_scheduler/test_thread_scope.c @@ -0,0 +1,20 @@ +#include +#include +#include + +int main(void) { + int scope; + pthread_attr_t attr; + + pthread_attr_init(&attr); + pthread_attr_setscope(&attr, PTHREAD_SCOPE_PROCESS); + + if (pthread_attr_getscope(&attr, &scope) != 0) { + fprintf(stderr, "Scope not found"); + return EXIT_FAILURE; + } else { + printf("The current scope is %d\n", scope); + } + + return EXIT_SUCCESS; +} diff --git a/chp7_deadlock/.gitkeep b/chp7_deadlock/.gitkeep new file mode 100644 index 0000000..e69de29