Skip to content

Commit a25d634

Browse files
authored
Merge pull request #688 from sanpeqf/fixup-atomic
fixup atomic: added pthread in link libraries
2 parents aa67031 + 58ca8b1 commit a25d634

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

examples/atomic/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55

66
add_executable(atomic-spinlock spinlock.c)
7-
target_link_libraries(atomic-spinlock bfdev)
7+
target_link_libraries(atomic-spinlock bfdev pthread)
88
add_test(atomic-spinlock atomic-spinlock)
99

1010
if(${CMAKE_PROJECT_NAME} STREQUAL "bfdev")

examples/atomic/spinlock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ thread1_task(void *unused)
3737
{
3838
unsigned int time;
3939

40-
for (time = 0; time < 1000000; ++time) {
40+
for (time = 0; time < 100000; ++time) {
4141
spin_lock(&lock);
4242
counter++;
4343
spin_unlock(&lock);
@@ -51,7 +51,7 @@ thread2_task(void *unused)
5151
{
5252
unsigned int time;
5353

54-
for (time = 0; time < 1000000; ++time) {
54+
for (time = 0; time < 100000; ++time) {
5555
spin_lock(&lock);
5656
counter--;
5757
spin_unlock(&lock);

0 commit comments

Comments
 (0)