[Wine] CRITICAL_SECTION hang my application

SteelRat wineforum-user at winehq.org
Sat Nov 20 01:54:34 CST 2010


Good Day, dear wine users :) .
I am the developer of program, which must work under Wine and Windows.  it has two threads, and these threads use one function to add text to Rich text box. When they try to add texts in parallel, a mixed text appear. So I decided to use critical section. When main thread tries to add text, the text adds perfectly, but when the second thread tries to add text - it hangs my app :( .
Here is the code in C++:

Code:
HWND__ *h_Edit = rtf_list->Handle;
 
EnterCriticalSection(&cr_sec);
CHARRANGE cr;
cr.cpMin = 0;
cr.cpMax = 0;
// App hangs on this line
SendMessage(h_Edit, EM_EXSETSEL, 0, (LPARAM)&cr);
 
  //.....
 
LeaveCriticalSection(&cr_sec);



Before this I use:


Code:
CRITICAL_SECTION cr_sec;
InitializeCriticalSection(&cr_sec);



to initialize Critical Section.







More information about the wine-users mailing list