28 Mar
2023
28 Mar
'23
3:30 p.m.
On Tue Mar 28 15:10:46 2023 +0000, Torge Matthies wrote:
@piotr Do you know what "synchronously blocked" might mean? I would need to find that out, but the implementation itself shouldn't be too hard, as you said it could just be a `LONG synchronously_blocked;` that is changed using `InterlockedOr`/`InterlockedAnd`. It returns true when thread is blocked (is waiting). See following code for an example:
static Context *ctx;
static critical_section cs;
static DWORD WINAPI lock_thread(void* p)
{
ctx = p_Context_CurrentContext();
trace("is blocked thread: %d\n", call_func1(p__Context_IsSynchronouslyBlocked, ctx));
call_func1(p_critical_section_lock, &cs)
return 0;
}
int main()
{
call_func1(p_critical_section_ctor, &cs);
call_func1(p_critical_section_lock, &cs)
CreateThread(NULL, 0, lock_thread, NULL, NULL, NULL);
Sleep(100);
trace("is blocked main: %d\n", call_func1(p__Context_IsSynchronouslyBlocked, ctx));
return 0;
}
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/1979#note_28225