Skip to content

Commit 5f53944

Browse files
committed
[libc] linux/raw_mutex.h -> raw_mutex.h
1 parent c80ecad commit 5f53944

File tree

12 files changed

+26
-41
lines changed

12 files changed

+26
-41
lines changed

libc/src/__support/threads/CndVar.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
#include "hdr/stdint_proxy.h" // uint32_t
1313
#include "src/__support/macros/config.h"
1414
#include "src/__support/threads/linux/futex_utils.h" // Futex
15-
#include "src/__support/threads/linux/raw_mutex.h" // RawMutex
1615
#include "src/__support/threads/mutex.h" // Mutex
16+
#include "src/__support/threads/raw_mutex.h" // RawMutex
1717

1818
namespace LIBC_NAMESPACE_DECL {
1919

libc/src/__support/threads/linux/CMakeLists.txt

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,13 @@ else()
3131
set(monotonicity_flags -DLIBC_COPT_TIMEOUT_ENSURE_MONOTONICITY=0)
3232
endif()
3333

34-
add_header_library(
35-
raw_mutex
36-
HDRS
37-
mutex.h
38-
DEPENDS
39-
.futex_utils
40-
libc.src.__support.threads.sleep
41-
libc.src.__support.time.abs_timeout
42-
libc.src.__support.time.monotonicity
43-
libc.src.__support.CPP.optional
44-
libc.hdr.types.pid_t
45-
COMPILE_OPTIONS
46-
-DLIBC_COPT_RAW_MUTEX_DEFAULT_SPIN_COUNT=${LIBC_CONF_RAW_MUTEX_DEFAULT_SPIN_COUNT}
47-
${monotonicity_flags}
48-
)
49-
5034
add_header_library(
5135
rwlock
5236
HDRS
5337
rwlock.h
5438
DEPENDS
5539
.futex_utils
56-
.raw_mutex
40+
libc.src.__support.threads.raw_mutex
5741
libc.src.__support.common
5842
libc.src.__support.OSUtil.osutil
5943
libc.src.__support.CPP.limits
@@ -63,16 +47,6 @@ add_header_library(
6347
${monotonicity_flags}
6448
)
6549

66-
add_header_library(
67-
mutex
68-
HDRS
69-
mutex.h
70-
DEPENDS
71-
.futex_utils
72-
.raw_mutex
73-
libc.src.__support.threads.mutex_common
74-
)
75-
7650
add_object_library(
7751
thread
7852
SRCS
@@ -119,7 +93,7 @@ add_object_library(
11993
libc.src.__support.OSUtil.osutil
12094
libc.src.__support.threads.linux.futex_word_type
12195
libc.src.__support.threads.mutex
122-
libc.src.__support.threads.linux.raw_mutex
96+
libc.src.__support.threads.raw_mutex
12397
libc.src.__support.CPP.mutex
12498
)
12599

libc/src/__support/threads/linux/CndVar.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88

99
#include "src/__support/threads/CndVar.h"
1010
#include "src/__support/CPP/mutex.h"
11-
#include "src/__support/OSUtil/syscall.h" // syscall_impl
11+
#include "src/__support/OSUtil/syscall.h" // syscall_impl
1212
#include "src/__support/macros/config.h"
1313
#include "src/__support/threads/linux/futex_word.h" // FutexWordType
14-
#include "src/__support/threads/linux/raw_mutex.h" // RawMutex
1514
#include "src/__support/threads/mutex.h" // Mutex
15+
#include "src/__support/threads/raw_mutex.h" // RawMutex
1616

1717
#include <sys/syscall.h> // For syscall numbers.
1818

libc/src/__support/threads/linux/rwlock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "src/__support/threads/identifier.h"
2323
#include "src/__support/threads/linux/futex_utils.h"
2424
#include "src/__support/threads/linux/futex_word.h"
25-
#include "src/__support/threads/linux/raw_mutex.h"
25+
#include "src/__support/threads/raw_mutex.h"
2626
#include "src/__support/threads/sleep.h"
2727

2828
#ifndef LIBC_COPT_RWLOCK_DEFAULT_SPIN_COUNT

libc/src/__support/threads/raw_mutex.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
//===--- Implementation of the RawMutex class ---------------*- C++ -*-===//
1+
//===--- Implementation of the RawMutex class -------------------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
7-
//===------------------------------------------------------------------===//
7+
//===----------------------------------------------------------------------===//
88
#ifndef LLVM_LIBC_SRC___SUPPORT_THREADS_RAW_MUTEX_H
99
#define LLVM_LIBC_SRC___SUPPORT_THREADS_RAW_MUTEX_H
1010

@@ -136,4 +136,4 @@ class RawMutex {
136136
};
137137
} // namespace LIBC_NAMESPACE_DECL
138138

139-
#endif // LLVM_LIBC_SRC___SUPPORT_THREADS_LINUX_RAW_MUTEX_H
139+
#endif // LLVM_LIBC_SRC___SUPPORT_THREADS_RAW_MUTEX_H

libc/src/__support/threads/unix_mutex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===--- Implementation of a Unix mutex class ------------------*- C++ -*-===//
1+
//===--- Implementation of a Unix mutex class -------------------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.

libc/src/threads/linux/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ add_header_library(
99
libc.src.__support.CPP.mutex
1010
libc.src.__support.OSUtil.osutil
1111
libc.src.__support.threads.mutex
12-
libc.src.__support.threads.linux.raw_mutex
12+
libc.src.__support.threads.raw_mutex
1313
libc.src.__support.threads.linux.futex_utils
1414
)
1515

libc/test/integration/src/pthread/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ add_integration_test(
6262
libc.src.pthread.pthread_rwlockattr_destroy
6363
libc.src.pthread.pthread_rwlockattr_setpshared
6464
libc.src.pthread.pthread_rwlockattr_setkind_np
65-
libc.src.__support.threads.linux.raw_mutex
65+
libc.src.__support.threads.raw_mutex
6666
libc.src.stdio.printf
6767
libc.src.stdlib.getenv
6868
libc.src.sys.mman.mmap

libc/test/integration/src/pthread/pthread_rwlock_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
#include "src/__support/CPP/new.h"
1313
#include "src/__support/OSUtil/syscall.h"
1414
#include "src/__support/macros/config.h"
15-
#include "src/__support/threads/linux/raw_mutex.h"
1615
#include "src/__support/threads/linux/rwlock.h"
16+
#include "src/__support/threads/raw_mutex.h"
1717
#include "src/__support/threads/sleep.h"
1818
#include "src/pthread/pthread_create.h"
1919
#include "src/pthread/pthread_join.h"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
add_libc_test(
2+
mutex_test
3+
SUITE
4+
libc-support-threads-tests
5+
SRCS
6+
mutex_test.cpp
7+
DEPENDS
8+
libc.src.__support.threads.mutex
9+
libc.src.__support.threads.darwin.futex_utils
10+
libc.src.__support.time.darwin.clock_gettime
11+
)

0 commit comments

Comments
 (0)