Module: wine Branch: master Commit: dcccf544bec042cfe76defaf4a97763a3f47a650 URL: https://gitlab.winehq.org/wine/wine/-/commit/dcccf544bec042cfe76defaf4a97763...
Author: Piotr Caban piotr@codeweavers.com Date: Fri Apr 14 12:54:09 2023 +0200
msvcr100: Add ExternalContextBase::Block() implementation.
---
dlls/msvcrt/concurrency.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/dlls/msvcrt/concurrency.c b/dlls/msvcrt/concurrency.c index ede70116f4a..565b911425e 100644 --- a/dlls/msvcrt/concurrency.c +++ b/dlls/msvcrt/concurrency.c @@ -100,6 +100,7 @@ typedef struct { struct scheduler_list scheduler; unsigned int id; union allocator_cache_entry *allocator_cache[8]; + LONG blocked; } ExternalContextBase; extern const vtable_ptr ExternalContextBase_vtable; static void ExternalContextBase_ctor(ExternalContextBase*); @@ -927,7 +928,16 @@ bool __thiscall ExternalContextBase_IsSynchronouslyBlocked(const ExternalContext DEFINE_THISCALL_WRAPPER(ExternalContextBase_Block, 4) void __thiscall ExternalContextBase_Block(ExternalContextBase *this) { - FIXME("(%p)->() stub\n", this); + LONG blocked; + + TRACE("(%p)->()\n", this); + + blocked = InterlockedIncrement(&this->blocked); + while (blocked >= 1) + { + RtlWaitOnAddress(&this->blocked, &blocked, sizeof(LONG), NULL); + blocked = this->blocked; + } }
DEFINE_THISCALL_WRAPPER(ExternalContextBase_Yield, 4)