From: Daniel Lehman Subject: [PATCH v2 2/4] include: Add xthreads.h with some _Thrd declarations. Message-Id: Date: Tue, 25 Jan 2022 17:04:33 +0000 From cd4b928a2bd0a51179e144e09124e753c0873cfe Mon Sep 17 00:00:00 2001 From: Daniel Lehman Date: Tue, 25 Jan 2022 07:26:12 -0800 Subject: [PATCH v2 2/4] include: Add xthreads.h with some _Thrd declarations. Signed-off-by: Daniel Lehman --- include/xthreads.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 include/xthreads.h diff --git a/include/xthreads.h b/include/xthreads.h new file mode 100644 index 000000000000..40d3aa4d5b45 --- /dev/null +++ b/include/xthreads.h @@ -0,0 +1,33 @@ +/* + * Copyright 2022 Daniel Lehman + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +#ifndef _THR_XTHREADS_H +#define _THR_XTHREADS_H + +typedef struct +{ + HANDLE hnd; + DWORD id; +} _Thrd_t; + +int __cdecl _Thrd_detach(_Thrd_t); +int __cdecl _Thrd_join(_Thrd_t thr, int *); +void __cdecl _Thrd_yield(void); +unsigned int __cdecl _Thrd_hardware_concurrency(void); +unsigned int __cdecl _Thrd_id(void); + +#endif -- 2.34.1