Add new mju_threadpool API function, and delete old threading API.

PiperOrigin-RevId: 922838541
Change-Id: Id9f7e0fb298ffde61fcc49a802dc78971858ce51
This commit is contained in:
Kyle Bayes
2026-05-28 10:09:07 -07:00
committed by Copybara-Service
parent a22fc2423a
commit b935d4153c
47 changed files with 576 additions and 1755 deletions
+10 -49
View File
@@ -5104,42 +5104,6 @@ STRUCTS: Mapping[str, StructDecl] = dict([
),
),
)),
('mjThreadPool',
StructDecl(
name='mjThreadPool',
declname='struct mjThreadPool_',
fields=(
StructFieldDecl(
name='nworker',
type=ValueType(name='int'),
doc='number of workers in the pool',
),
),
)),
('mjTask',
StructDecl(
name='mjTask',
declname='struct mjTask_',
fields=(
StructFieldDecl(
name='func',
type=ValueType(name='mjfTask'),
doc='pointer to the function that implements the task',
),
StructFieldDecl(
name='args',
type=PointerType(
inner_type=ValueType(name='void'),
),
doc='arguments to func',
),
StructFieldDecl(
name='status',
type=ValueType(name='int', is_volatile=True),
doc='status of the task',
),
),
)),
('mjPreContact',
StructDecl(
name='mjPreContact',
@@ -5422,19 +5386,21 @@ STRUCTS: Mapping[str, StructDecl] = dict([
type=ValueType(name='size_t'),
doc='first available byte in arena',
),
StructFieldDecl(
name='threadpool',
type=ValueType(name='uintptr_t'),
doc='thread pool pointer',
),
StructFieldDecl(
name='threadlock',
type=ValueType(name='mjtBool'),
doc='disable stack freeing during threaded execution',
),
StructFieldDecl(
name='maxuse_stack',
type=ValueType(name='mjtSize'),
doc='maximum stack allocation in bytes (mutable)',
),
StructFieldDecl(
name='maxuse_threadstack',
type=ArrayType(
inner_type=ValueType(name='mjtSize'),
extents=(128,),
),
doc='maximum stack allocation per thread in bytes',
),
StructFieldDecl(
name='maxuse_arena',
type=ValueType(name='mjtSize'),
@@ -6903,11 +6869,6 @@ STRUCTS: Mapping[str, StructDecl] = dict([
doc='constraint force',
array_extent=('nidof',),
),
StructFieldDecl(
name='threadpool',
type=ValueType(name='uintptr_t'),
doc='thread pool pointer',
),
StructFieldDecl(
name='signature',
type=ValueType(name='uint64_t'),