We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents aa67031 + 58ca8b1 commit a25d634Copy full SHA for a25d634
2 files changed
examples/atomic/CMakeLists.txt
@@ -4,7 +4,7 @@
4
#
5
6
add_executable(atomic-spinlock spinlock.c)
7
-target_link_libraries(atomic-spinlock bfdev)
+target_link_libraries(atomic-spinlock bfdev pthread)
8
add_test(atomic-spinlock atomic-spinlock)
9
10
if(${CMAKE_PROJECT_NAME} STREQUAL "bfdev")
examples/atomic/spinlock.c
@@ -37,7 +37,7 @@ thread1_task(void *unused)
37
{
38
unsigned int time;
39
40
- for (time = 0; time < 1000000; ++time) {
+ for (time = 0; time < 100000; ++time) {
41
spin_lock(&lock);
42
counter++;
43
spin_unlock(&lock);
@@ -51,7 +51,7 @@ thread2_task(void *unused)
51
52
53
54
55
56
counter--;
57
0 commit comments