Skip to content

Commit 95f2e76

Browse files
committed
added tsd_once to build
1 parent 6c2ad8b commit 95f2e76

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,6 @@ target_link_libraries(barrier_main ${CMAKE_THREAD_LIBS_INIT})
5959
add_executable(workq_main workq_main.c workq.c)
6060
target_link_libraries(workq_main ${CMAKE_THREAD_LIBS_INIT} ${RT_LIB})
6161

62+
# build tsd_once
63+
add_executable(tsd_once tsd_once.c)
64+
target_link_libraries(tsd_once ${CMAKE_THREAD_LIBS_INIT})

tsd_once.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ void *thread_routine (void *arg)
6161
sleep (2);
6262
value = (tsd_t*)pthread_getspecific (tsd_key);
6363
printf ("%s done...\n", value->string);
64-
return NULL;
64+
return NULL;
6565
}
6666

67-
void main (int argc, char *argv[])
67+
int main (int argc, char *argv[])
6868
{
6969
pthread_t thread1, thread2;
7070
int status;
@@ -78,4 +78,5 @@ void main (int argc, char *argv[])
7878
if (status != 0)
7979
err_abort (status, "Create thread 2");
8080
pthread_exit (NULL);
81+
return 0;
8182
}

0 commit comments

Comments
 (0)