Skip to content

Commit e73e6a8

Browse files
committed
thread: add pthread-based threading module
Parametrizable threading module.
1 parent ca051a1 commit e73e6a8

12 files changed

Lines changed: 1333 additions & 0 deletions

File tree

Cargo.lock

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ default-members = [
1919
"src/containers",
2020
"src/sync",
2121
"src/elementary",
22+
"src/pal",
23+
"src/thread",
2224
"src/log/score_log_fmt_macro",
2325
"src/log/stdout_logger",
2426
"src/testing_macros",
@@ -28,6 +30,8 @@ members = [
2830
"src/containers",
2931
"src/sync",
3032
"src/elementary",
33+
"src/pal",
34+
"src/thread",
3135
"src/log/score_log",
3236
"src/log/score_log_fmt",
3337
"src/log/score_log_fmt_macro",
@@ -44,12 +48,17 @@ license-file = "LICENSE.md"
4448
authors = ["S-CORE Contributors"]
4549

4650
[workspace.dependencies]
51+
libc = "0.2.177"
52+
53+
containers = { path = "src/containers" }
4754
score_log = { path = "src/log/score_log" }
4855
score_log_fmt = { path = "src/log/score_log_fmt" }
4956
score_log_fmt_macro = { path = "src/log/score_log_fmt_macro" }
5057
stdout_logger = { path = "src/log/stdout_logger" }
5158
elementary = { path = "src/elementary" }
5259
testing_macros = { path = "src/testing_macros" }
60+
pal = { path = "src/pal" }
61+
thread = { path = "src/thread" }
5362

5463
[workspace.lints.clippy]
5564
std_instead_of_core = "warn"

src/pal/BUILD

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
14+
load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test")
15+
16+
rust_library(
17+
name = "pal",
18+
srcs = glob(["**/*.rs"]),
19+
edition = "2021",
20+
visibility = ["//src:__subpackages__"],
21+
deps = [
22+
"//src/containers",
23+
"//src/log/score_log",
24+
"@score_crates//:libc",
25+
],
26+
)
27+
28+
rust_test(
29+
name = "tests",
30+
crate = "pal",
31+
tags = [
32+
"unit_tests",
33+
"ut",
34+
],
35+
)

src/pal/Cargo.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
14+
[package]
15+
name = "pal"
16+
description = "Minimal POSIX adaptation layer."
17+
version.workspace = true
18+
authors.workspace = true
19+
readme.workspace = true
20+
edition.workspace = true
21+
22+
[lib]
23+
path = "lib.rs"
24+
25+
[dependencies]
26+
libc.workspace = true
27+
containers.workspace = true
28+
score_log.workspace = true

0 commit comments

Comments
 (0)