2 * Copyright 2022 Daniel Lehman
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include "wine/debug.h"
24 WINE_DEFAULT_DEBUG_CHANNEL(msvcp
);
26 extern unsigned int __cdecl
_Thrd_hardware_concurrency(void);
28 unsigned int __stdcall
__std_parallel_algorithms_hw_threads(void)
31 return _Thrd_hardware_concurrency();
34 void __stdcall
__std_bulk_submit_threadpool_work(PTP_WORK work
, size_t count
)
36 TRACE("(%p %Iu)\n", work
, count
);
38 SubmitThreadpoolWork(work
);
41 void __stdcall
__std_close_threadpool_work(PTP_WORK work
)
43 TRACE("(%p)\n", work
);
44 return CloseThreadpoolWork(work
);
47 PTP_WORK __stdcall
__std_create_threadpool_work(PTP_WORK_CALLBACK callback
, void *context
,
48 PTP_CALLBACK_ENVIRON environ
)
50 TRACE("(%p %p %p)\n", callback
, context
, environ
);
51 return CreateThreadpoolWork(callback
, context
, environ
);
54 void __stdcall
__std_submit_threadpool_work(PTP_WORK work
)
56 TRACE("(%p)\n", work
);
57 return SubmitThreadpoolWork(work
);
60 void __stdcall
__std_wait_for_threadpool_work_callbacks(PTP_WORK work
, BOOL cancel
)
62 TRACE("(%p %d)\n", work
, cancel
);
63 return WaitForThreadpoolWorkCallbacks(work
, cancel
);
66 void __stdcall
__std_atomic_notify_one_direct(void *addr
)
68 TRACE("(%p)\n", addr
);
69 WakeByAddressSingle(addr
);
72 void __stdcall
__std_atomic_notify_all_direct(void *addr
)
74 TRACE("(%p)\n", addr
);
75 WakeByAddressAll(addr
);
78 BOOL __stdcall
__std_atomic_wait_direct(volatile void *addr
, void *cmp
,
79 SIZE_T size
, DWORD timeout
)
81 TRACE("(%p %p %Id %ld)\n", addr
, cmp
, size
, timeout
);
82 return WaitOnAddress(addr
, cmp
, size
, timeout
);